open-index/open-npm huggingface dataset:
npm package: @parkingboss/svelte-storage
Description: Cross Platform Permanent Storage stores (using store.js)
Author: Parking Boss
Latest version: 1.0.5

# Svelte Storage

This gives you a svelte store used exactly like
`import { writable, readable } from 'svelte/store'` that is persisted longer
than your session by using store.js.

## Usage

 1. Install it: `npm i @parkingboss/svelte-storage`
 2. Import it: `import { readable, writable } from '@parkingboss/svelte-storage'`.
 3. Use them.

## API

The api was designed to be as similar to `svelte/storage` as possible, but using
storage keys intead of functions to back the store.

### readable

`readable(initial: any, storageKey: string): Readable<any>;`

The signature of `readable` is almost the same as the signature of `readable`
from Svelte. Unlike Svelte, however, this function just takes a string as its
second parameter. It uses that key with store.js to fetch and set longer term
storage for your store.

```
export const fromStorage = readable([], storageKey: 'app-readable');

fromStorage.subscribe(newVal => {
  console.log(newVal); // Logs `[]`
});

store.set('app-readable', [ 1, 2 3 ]); // Logs `[ 1, 2, 3 ]`
store.remove('app-readable'); // Logs `null`
```

### writable

`writable(initial: any, storageKey: string): Writable<any>`

The signature of `writable` is almost the same as the signature of `writable`
from Svelte, except the second parameter is required, and must be a string.
Under the hood this uses `readable` to create the subscription function and adds
helpers for setting and updating (like Svelte does). This is more redundant than
Svelte's `writable` because here you can just use `store.js` to update the value
and `readable` will pick up the changes.

```
export const fromStorage = writable([], storageKey: 'app-writable');

fromStorage.subscribe(newVal => {
  console.log(newVal); // Logs `[]`
});

fromStorage.update(x => x.concat([ 1, 2 3 ])); // Logs `[ 1, 2, 3 ]`
fromStorage.set([]); // Logs `null`
```
npm package: @parkour-ops/application-configuration
Description: Define and initialise Typescript-friendly global read-only application configuration in runtime.
Author: Tej Birring
Latest version: 1.1.0

# Application Configuration

* Define and initialise Typescript-friendly global read-only application configuration in runtime.

* Populate each config value using either a value (or source of value, e.g. function) (`fromVal`), an inline function (`fromFunc`), or the environment variable parser (`fromEnv`).

* Validate config values using [Zod](https://zod.dev/) schema validation library, optionally using built-in base schemas: `String`, `Number`, `Int`, `BigInt`, and `Boolean`.

## How to Use

1. Create a `config.ts` file:

    This file will define and export your app configuration.

    Import and use `createConfig({...})` to define the configuration.

    ```ts
    import { Boolean, Integer, String, configVar, createConfig, fromEnv, fromFunc, fromVal } from "../src";

    const config = createConfig({
        // config can be sourced from env vars using `fromEnv`
        // "REQUIRED" will ensure error is thrown if env var has not been set
        hostUrl: configVar("Host URL", "REQUIRED", String.url())(fromEnv("HOST")),
        // config can be sourced from (in-line) functions using `fromFunc`
        timeout: configVar("Timeout (in seconds)", "REQUIRED", Int)(fromFunc(()=>{
            const minCeiled = Math.ceil(5);
            const maxFloored = Math.floor(10);
            return Math.floor(Math.random() * (maxFloored - minCeiled + 1) + minCeiled); // The maximum is inclusive and the minimum is inclusive
        })
        ),
        // config can be sourced from pre-defined values or existing functions using `fromVal`
        // this example uses a custom schema
        protocol: configVar("Protocol", "REQUIRED", AvailableProtocol)(fromVal("HTTP")),
        // configs can be nested
        a: {
            b: {
                c: {
                    portNumber: configVar("Port Number", "REQUIRED", Int)(fromEnv("PORT"))
                },
            }
        },
        // env vars can be parsed as boolean, the following (case-insensitive) evaluate to TRUE: "true", "yes", "t", "y"
        // "OPTIONAL" means error will NOT be thrown if env var has not been set, will instead evaluate to FALSE (for boolean schema) or UNDEFINED (for non-boolean schema).
        forceTLS: configVar("Force Transport Layer Security (TLS)", "OPTIONAL", Boolean)(fromEnv("FORCE_TLS"))
    });
    ```

2. Access your configuration from other source files:

    ```ts
    import config from "config.ts"

    console.log(config.a.b.c.portNumber);
    // 8080

    console.log(typeof config.a.b.c.portNumber);
    // number
    ```
npm package: @parksb/markdown-it-image-lazy-loading
Description: a markdown-it plugin supporting Chrome 75's native image lazy-loading
Author: parksb
Latest version: 2.0.2

A markdown-it plugin supporting Chrome 75's [native image lazy-loading](https://addyosmani.com/blog/lazy-loading/) and [async decoding](https://github.com/whatwg/html/pull/3221).

## Install

```bash
$ npm install markdown-it-image-lazy-loading
```

## Usage

Load it in ES module.

```javascript
import markdownit from 'markdown-it';
import lazy_loading from 'markdown-it-image-lazy-loading';

const md = markdownit();
md.use(lazy_loading);
md.render(`![](example.png "image title")`);
// <p><img src="example.png" alt="" title="image title" loading="lazy"></p>\n
```

Or load it in CommonJS module.

```javascript
const md = require('markdown-it')();
const lazy_loading = require('markdown-it-image-lazy-loading');
md.use(lazy_loading);

md.render(`![](example.png "image title")`);
// <p><img src="example.png" alt="" title="image title" loading="lazy"></p>\n
```

If you want the `decoding="async"` attribute, enable the plugin's `decoding` option.

```javascript
md.use(lazy_loading, {
  decoding: true,
});

md.render(`![](example.png "image title")`);
// <p><img src="example.png" alt="" title="image title" loading="lazy" decoding="async"></p>\n
```

The plugin can also add `width` and `height` attributes to each image. This can prevent [cumulative layout shifts (CLS)](https://web.dev/cls/):

```javascript
md.use(lazy_loading, {
  image_size: true,

  // Where your images are stored
  base_path: __dirname + 'src/',
});

md.render(`![](example.png "image title")`);
// <p><img src="example.png" alt="" title="image title" loading="lazy" width="100" height="100"></p>\n
```

To keep images responsive, also include the following CSS:
```css
img{
    max-width: 100%;
    height: auto;
}
```

## License

MIT
npm package: @parksb/md2html
Description: `md2html` is a tool for converting Markdown to HTML, with support for customizable templates.
Author: parksb
Latest version: 0.0.10

# md2html

`md2html` is a tool for converting Markdown to HTML, with support for customizable templates.

```
Usage: md2html [FILE] [-o FILE] [-t NAME]

Commands:
  md2html [input]     Convert a markdown to HTML                       [default]
  md2html templates   Show available templates

Positionals:
  input  Input file path                                                [string]

Options:
      --version   Show version number                                  [boolean]
      --help      Show help                                            [boolean]
  -o, --output    Output file path                                      [string]
  -t, --template  Template name                    [string] [default: "default"]
      --toc-min   Minimum heading level to include in the table of contents
                                                           [number] [default: 2]
      --toc-max   Maximum heading level to include in the table of contents
                                                           [number] [default: 4]
      --html      Allow HTML in the input             [boolean] [default: false]

Examples:
  md2html input.md -o output.html       Convert input.md to output.html.
  cat input.md | md2html > output.html  Convert input.md to output.html.
```

## Installation

Install `md2html` using npm (or any package manager of your choice).

```sh
$ npm install -g @parksb/md2html
```

For macOS users, md2html is also available via Homebrew.

```sh
$ brew install parksb/x/md2html
```

## Usage

You can generate HTML directly to stdout by passing Markdown text via stdin.

```
$ echo "# Title" | md2html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
  </head>
  <body>
    <h1 id="title" tabindex="-1">Title</h1>
  </body>
</html>
```

The key feature is its support for customizable templates. You can specify a template using the `-t` option to tailor the output to your needs.

```
$ cat input.md | md2html -t paper
```

The following templates are included by default:

- `pure`
- `paper`
- `github`

If no template is specified, the default template(`pure`) is used.

You can create your own templates by adding them to the templates directory. To find the template directory, run with the `templates` command.

```
$ md2html templates
/path/to/templates
default
github
paper
pure
```

To add a custom template, create a `.ejs` file in the template directory(e.g., `/path/to/templates`). The template file can use two variables: `document.title` and `document.html`. Refer to the `pure` template for a simple example of how to structure a custom template.
npm package: @parkwhiz-js/react-popover
Description: Smart popover component for React. Closes when you click away, no need to reclick the trigger button to close it
Author: Dan Caragea
Latest version: 2.1.0-rc10

# react-popover
Smart popover component for React. Closes when you click away, no need to reclick the trigger button to close it.

For full docs and demo see http://projects.5mins.me/react-popover/

## Installation

```
npm i @terebentina/react-popover -S
```

## Usage

```javascript
import React from 'react';
import Popover from '@terebentina/react-popover';

// optional, you can bring your own styles if you want
import '@terebentina/react-popover/lib/styles.css';

class MyComponent extends React.Component {
 render() {
    return (
      <div>
        If you want to see a nice popover 
        <Popover position="bottom" className="awesome" trigger="click me">
          here I am in all my glory!
        </Popover>
      </div>
    );
```

## License

[The MIT License](./LICENSE)

Copyright (c) 2016 Dan Caragea
npm package: @parkyang/mp-socket.io-client
Description: 适用于小程序的socket.io封装，可用于支付宝小程序、微信小程序
Author: yangming19880509@163.com
Latest version: 1.0.1

## @parkyang/mp-socket.io-client

仅支持 Server 端 `Socket.io 2.x`

项目源自：[@hyoga/uni-socket.io](https://github.com/guyue88/hyoga-uni-socket.io) `version：1.0.0`。

原项目不支持支付宝小程序

如果该项目对您有帮助，可以给作者一个[star](https://github.com/parkyang/mp-socket.io-client)。

### 介绍

重写 socket.io-client 的 engin.io-client 处理件，h5 依旧使用原生 WebSocket，APP 与小程序使用 uni-app 的 WebSocket 协议，所以 h5 端任然可以支持长轮询等方式，APP 与小程序只能支持 WebSocket 协议。

### 安装

```
// 建议使用npm或yarn包形式引入以保证插件的更新迭代
npm i @parkyang/mp-socket.io-client --save
// yarn add @parkyang/mp-socket.io-client
```

### 使用

```
import io from '@parkyang/mp-socket.io-client';

const socket = io('your websocket path', {
  query: {},
  transports: [ 'websocket', 'polling' ],
  timeout: 5000,
});

socket.on('connect', () => {
  // ws连接已建立，此时可以进行socket.io的事件监听或者数据发送操作
  // 连接建立后，本插件的功能已完成，接下来的操作参考socket.io官方客户端文档即可
  console.log('ws 已连接');
  // socket.io 唯一连接id，可以监控这个id实现点对点通讯
  const { id } = socket;
  socket.on(id, (message) => {
    // 收到服务器推送的消息，可以跟进自身业务进行操作
    console.log('ws 收到服务器消息：', message);
  });
  // 主动向服务器发送数据
  socket.emit('send_data', {
    time: +new Date(),
  });
});

socket.on('error', (msg: any) => {
  console.log('ws error', msg);
});
```

更多使用方法，请参考[socket.io-client](https://github.com/socketio/socket.io-client)写法即可。

### API

参考[官网 API](https://socket.io/docs/client-api/)

### 常见问题

1. 为什么没有聊天室示例代码？

   本项目仅仅是将 socket.io 封装到 uni-app 使用，并非完整的聊天室。

2. Exception: ReferenceError: Can't find variable: window

   hbuilder x 2.6.3 版本中 v3 编译有 bug，升级 hbuilder x 即可。

3. 真机运行 TypeError: undefined is not an object (evaluating 'document.createElement')？  
   示例代码中：

   ```
   const socket = io('your websocket path', {
     query: {},
     transports: [ 'websocket', 'polling' ],
     timeout: 5000,
   });
   ```

   不要漏写`transports: [ 'websocket', 'polling' ]`，如果没有指定协议，貌似 socket.io 会默认走`JSONP Polling`请求，导致报错。
npm package: @parlats/cli
Description: CLI for syncing translations with Parlats
Latest version: 1.0.2

# @parlats/cli

CLI for syncing translations between your project and [Parlats](https://parlats.com).

## Install

```bash
npm i -g @parlats/cli
```

## Quick Start

1. Create an API key in your Parlats project settings
2. Set your key:
   ```bash
   export PARLATS_API_KEY=trad_...
   ```
3. Initialize your project:
   ```bash
   parlats init
   ```
4. Pull translations:
   ```bash
   parlats pull
   ```

## Commands

### `parlats init`

Set up `.parlats.yml` in your project. Walks you through selecting a preset, project, and file pattern.

```bash
parlats init
parlats init --preset next-intl --host https://parlats.com
```

**Presets:** `next-intl`, `i18next`, `next-i18next`, `react-intl`, `vue-i18n`

### `parlats pull`

Download translations from Parlats and write them to your local files.

```bash
parlats pull
parlats pull --locale es,fr
parlats pull --namespace common
parlats pull --dry-run
```

### `parlats push`

Upload local translation files to Parlats.

```bash
parlats push
parlats push --locale en
parlats push --add-only        # only push new keys, don't overwrite
parlats push --force           # skip confirmation for changed values
parlats push --dry-run
```

### `parlats status`

Show translation progress per locale.

```bash
parlats status
parlats status --json          # machine-readable output
```

## Configuration

`parlats init` creates a `.parlats.yml` file:

```yaml
host: "https://parlats.com"
project_id: "your-project-uuid"
api_key_env: "PARLATS_API_KEY"
source_locale: "en"
files:
  path: "messages/{locale}.json"
  format: "json-nested"
```

The API key is read from the environment variable specified in `api_key_env` (default: `PARLATS_API_KEY`). Add it to your `.env` file or set it in your shell.

## File Patterns

Use `{locale}` and `{namespace}` placeholders in `files.path`:

| Pattern | Example |
|---------|---------|
| `messages/{locale}.json` | `messages/en.json` |
| `public/locales/{locale}/{namespace}.json` | `public/locales/en/common.json` |
| `lang/{locale}.json` | `lang/en.json` |
| `src/locales/{locale}.json` | `src/locales/en.json` |

## License

MIT