open-index/open-npm huggingface dataset:
npm package: @styleseeker/logger
Description: Shared logger package for StyleSeeker microservices.
Latest version: 1.0.0

# StyleSeeker Logger

A shared, styled logger package for all StyleSeeker microservices, built on top of [pino](https://getpino.io/).

## Features
- Fast, structured logging with `pino`
- Pretty, colorized output in development
- Easy to use: import and log
- Supports child loggers for context

## Usage

### Install

In your microservice:

```
npm install --workspace <your-service> ../packages/logger
```

### Example

```typescript
import logger, { createLogger } from '@styleseeker/logger';

logger.info('Hello from the main logger!');

const serviceLogger = createLogger({ service: 'user-service' });
serviceLogger.error('Something went wrong');
```

## Environment Variables
- `NODE_ENV`: Set to `production` for JSON logs, otherwise pretty logs
- `LOG_LEVEL`: Set log level (default: `info`)
npm package: @styleshit/json-parser
Description: Simple JSON to AST parser in TypeScript
Author: StyleShit
Latest version: 0.0.1

# JSON Parser

Simple JSON to AST parser in TypeScript.

This parser has a custom grammar and exists for learning purposes.

## Features

The parser supports the following JSON types:

- `null`
- `boolean`
- `number`
- `string`
- `array`
- `object`

In addition, it supports trailing commas in arrays and objects (for god's sake!).

## Installation

```bash
npm install @styleshit/json-parser
```

## Usage

To use it, import the `parse` function and pass a JSON string to it.

For example, this code:

```typescript
import { parse } from '@styleshit/json-parser';

const ast = parse('{"hello": "world", "foo": 42,}');

console.log(ast);
```

Will output:

```typescript
{
  kind: 'object',
  members: {
    hello: {
      kind: 'string',
      value: 'world',
    },
    foo: {
      kind: 'number',
      value: 42,
    },
  },
}
```

While this code will throw an error:

```typescript
import { parse } from '@styleshit/json-parser';

const ast = parse('{"hello": "world", "foo": 42} true');

// SyntaxError: Unexpected 't' at index 30
```
npm package: @styleshit/vite-plugin-twig-loader
Description: Vite plugin for loading Twig templates
Author: StyleShit
Latest version: 0.1.1

# Vite Plugin Twig Loader

A Vite plugin that helps you loading Twig templates inside your application.

## Usage:

Install the plugin:

```BASH
npm i -D @styleshit/vite-plugin-twig-loader
```

Add it to your `vite.config.js`:

```TS
// vite.config.js
import { defineConfig } from 'vite'
import twig from '@styleshit/vite-plugin-twig-loader';

export default defineConfig({
	plugins: [twig()],
})
```

Now, you can import your Twig templates as if they were regular JavaScript modules:

```TWIG
<!-- src/App.twig -->

<h1>Hello {{ name }}!</h1>
```

```TS
// src/main.ts
import App from './App.twig';

App.render({
	name: 'John',
});
```

## Usage with TypeScript:

By default, TypsScript won't know how to handle Twig files. To fix this, you can add a declaration file to the project:

```TS
// src/types/twig.d.ts
declare module '*.twig' {
	import { Template } from 'twig';

	const contents: Template;

	export default contents;
}
```

And then, make sure it's being included in your `tsconfig.json`:

```JSON
{
	"include": [
		"src/types/**/*.d.ts"
	]
}
```

> [!NOTE]  
> If you already have a `types` folder in your project, or your `src` directory is already in the `include` array, you can adapt the paths to your needs.
npm package: @styleshit/xml-parser
Description: Simple XML to AST parser in TypeScript
Author: StyleShit
Latest version: 0.0.1

# XML Parser

Simple XML to AST parser in TypeScript.

This parser has a custom grammar and exists for learning purposes.

## Features

The parser supports elements ('<element>'), attributes ('<element attribute="value">'), and text nodes ('<element>text</element>').

It does not support comments, self-closing tags, or other XML features.

## Installation

```bash
npm install @styleshit/xml-parser
```

## Usage

To use it, import the `parse` function and pass an XML string to it.

For example, this code:

```typescript
import { parse } from '@styleshit/xml-parser';

const ast = parse(`
    <root>
        <element attribute="value">first text</element>
    </root>
    <sibling>another text</sibling>
`);

console.log(ast);
```

Will output:

```typescript
const ast = {
  kind: 'document',
  children: [
    {
      kind: 'element',
      name: 'root',
      children: [
        {
          kind: 'element',
          name: 'element',
          children: [
            {
              kind: 'text',
              text: 'first text',
            },
          ],
          attributes: {
            attribute: 'value',
          },
        },
      ],
      attributes: {},
    },
    {
      kind: 'element',
      name: 'sibling',
      children: [
        {
          kind: 'text',
          text: 'another text',
        },
      ],
      attributes: {},
    },
  ],
};
```

While this code will throw an error:

```typescript
import { parse } from '@styleshit/xml-parser';

const ast = parse('<element>text</another-element>');

// SyntaxError: Expected closing tag for 'element' at index 13. Got 'another-element' instead.
```
npm package: @stylex-extend/babel-plugin
Description: A friendly stylex babel plugin extension.
Latest version: 0.7.1

# @stylex-extend/babel-plugin

## Quick Start

### Install

```bash
yarn add @stylex-extend/babel-plugin
```

### Usage

```js
// .babelrc.js

module.exports = {
  plugins: ['@stylex-extend/babel-plugin', '@stylexjs/babel-plugin']
}
```
npm package: @stylex-extend/core
Description: ## Quick Start
Latest version: 0.7.1

# @stylex-extend/core

## Quick Start

### Install

```bash
yarn add @stylex-extend/core
```

### Usage

```js
import { injectGlobalStyle } from '@styex-extend/css'

const styles = css({
  p: {
    color: 'red'
  }
})
```
npm package: @stylex-extend/postcss
Description: ## Quick Start
Latest version: 0.7.1

# @stylex-extend/postcss

## Quick Start

### Install

```bash
yarn add @stylex-extend/postcss autoprefixer -D
```

### Usage

```js
// .babelrc.js

module.exports = {
  plugins: ['@stylex-extend/babel-plugin', '@stylexjs/babel-plugin']
}
```

Add the following to your postcss.config.js

```js
module.exports = {
  plugins: {
    '@stylex-extend/postcss': {
      include: ['src/**/*.{js,jsx,ts,tsx}']
    },
    autoprefixer: {}
  }
}
```