open-index/open-npm huggingface dataset:
npm package: @substrate-system/arrow-next
Description: ![tests](https://github.com/substrate-system/arrow-next/actions/workflows/nodejs.yml/badge.svg) [![types](https://img.shields.io/npm/types/@substrate-system/arrow-next?style=flat-square)](README.md) [![module](https://img.shields.io/badge/module-ESM%2FCJS
Author: nichoth
Latest version: 0.0.2

# arrow next
![tests](https://github.com/substrate-system/arrow-next/actions/workflows/nodejs.yml/badge.svg)
[![types](https://img.shields.io/npm/types/@substrate-system/arrow-next?style=flat-square)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![install size](https://packagephobia.com/badge?p=@substrate-system/arrow-next)](https://packagephobia.com/result?p=@substrate-system/arrow-next)
[![dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg?style=flat-square)](package.json)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

A next button icon.

[See a live demo](https://substrate-system.github.io/arrow-next/)

<!-- toc -->

- [install](#install)
- [API](#api)
  * [ESM](#esm)
  * [Common JS](#common-js)
- [CSS](#css)
  * [Import CSS](#import-css)
- [use](#use)
  * [JS](#js)
  * [HTML](#html)
  * [pre-built](#pre-built)

<!-- tocstop -->

## install

```sh
npm i -S @substrate-system/arrow-next
```

## API

> [!IMPORTANT]  
> This depends on a CSS class `visually-hidden`.
> See [Accessible Icon Buttons](https://www.sarasoueidan.com/blog/accessible-icon-buttons/).
> Install `@substrate-system/css-util` for help. 

This exposes ESM and common JS via [package.json `exports` field](https://nodejs.org/api/packages.html#exports).

### ESM
```js
import '@substrate-system/arrow-next'
```

### Common JS
```js
require('@substrate-system/arrow-next')
```

## CSS
This depends on a CSS definition for `.visually-hidden`. Install `@substrate-system/css-util`:

```sh
npm i -S @substrate-system/css-util
```

### Import CSS

```js
import '@substrate-system/css-util/visually-hidden'
import '@substrate-system/arrow-next/css'
```

Or minified:
```js
import '@substrate-system/css-util/min/visually-hidden'
import '@substrate-system/arrow-next/css/min'
```

## use
This calls the global function `customElements.define`. Just import, then use
the tag in your HTML.

### JS
```js
import '@substrate-system/arrow-next'
```

### HTML
```html
<div>
    <arrow-next></arrow-next>
</div>
```

### pre-built
This package exposes minified JS and CSS files too. Copy them to a location that is
accessible to your web server, then link to them in HTML.

#### copy
```sh
cp ./node_modules/@substrate-system/arrow-next/dist/index.min.js ./public/arrow-next.min.js
cp ./node_modules/@substrate-system/arrow-next/dist/style.min.css ./public/arrow-next.css
```

#### HTML
```html
<head>
    <link rel="stylesheet" href="./arrow-next.css">
</head>
<body>
    <!-- ... -->
    <script type="module" src="./arrow-next.min.js"></script>
</body>
```
npm package: @substrate-system/arrow-prev
Description: Back arrow button as a web component
Author: nichoth
Latest version: 0.0.2

# arrow prev
![tests](https://github.com/substrate-system/arrow-prev/actions/workflows/nodejs.yml/badge.svg)
[![types](https://img.shields.io/npm/types/@substrate-system/arrow-prev?style=flat-square)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![install size](https://packagephobia.com/badge?p=@substrate-system/arrow-prev)](https://packagephobia.com/result?p=@substrate-system/arrow-prev)
[![dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg?style=flat-square)](package.json)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

An icon button for going backwards.

[See a live demo](https://substrate-system.github.io/arrow-prev/)

<!-- toc -->

- [install](#install)
- [API](#api)
  * [ESM](#esm)
  * [Common JS](#common-js)
- [CSS](#css)
  * [`@substrate-system/css-util`](#substrate-systemcss-util)
  * [Import this module's CSS](#import-this-modules-css)
- [use](#use)
  * [JS](#js)
  * [HTML](#html)
  * [pre-built](#pre-built)

<!-- tocstop -->

## install

```sh
npm i -S @substrate-system/arrow-prev
```

## API

This exposes ESM and common JS via [package.json `exports` field](https://nodejs.org/api/packages.html#exports).

### ESM
```js
import '@substrate-system/arrow-prev'
```

### Common JS
```js
require('@substrate-system/arrow-prev')
```

## CSS

### `@substrate-system/css-util`

Use `@substrate-system/css-util/arrow`, or import CSS from this module.

```js
import '@substrate-system/css-util/arrow'
```

### Import this module's CSS

```js
import '@substrate-system/arrow-prev/css'
```

Or minified:
```js
import '@substrate-system/arrow-prev/css/min'
```

## use
This calls the global function `customElements.define`. Just import, then use
the tag in your HTML.

### JS
```js
import '@substrate-system/arrow-prev'
```

### HTML
```html
<div>
    <arrow-prev></arrow-prev>
</div>
```

### pre-built
This package exposes minified JS and CSS files too. Copy them to a location that is
accessible to your web server, then link to them in HTML.

#### copy
```sh
cp ./node_modules/@substrate-system/arrow-prev/dist/index.min.js ./public/arrow-prev.min.js
cp ./node_modules/@substrate-system/arrow-prev/dist/style.min.css ./public/arrow-prev.css
```

#### HTML
```html
<head>
    <link rel="stylesheet" href="./arrow-prev.css">
</head>
<body>
    <!-- ... -->
    <script type="module" src="./arrow-prev.min.js"></script>
</body>
```
npm package: @substrate-system/css-util
Description: [![install size](https://packagephobia.com/badge?p=@substrate-system/css-util)](https://packagephobia.com/result?p=@substrate-system/css-util) [![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://s
Author: nichoth
Latest version: 0.0.5

# CSS util
[![install size](https://packagephobia.com/badge?p=@substrate-system/css-util)](https://packagephobia.com/result?p=@substrate-system/css-util)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Common CSS

[See a live demo](https://substrate-system.github.io/css-util/)

<!-- toc -->

- [install](#install)
- [use](#use)
  * [Import CSS](#import-css)
  * [pre-built](#pre-built)
- [modules](#modules)
  * [`visually-hidden`](#visually-hidden)
  * [`arrow`](#arrow)

<!-- tocstop -->

## install

```sh
npm i -S @substrate-system/css-util
```

## use
This exposes CSS only.

### Import CSS

```js
import '@substrate-system/css-util'
```

Or minified:
```js
import '@substrate-system/css-util/min'
```

### pre-built
This package contains minified CSS files too. Copy them to a location that is
accessible to your web server, then link to them in HTML.

#### copy
```sh
cp ./node_modules/@substrate-system/css-util/dist/index.min.css ./public/css-util.css
```

#### HTML
```html
<head>
    <link rel="stylesheet" href="./css-util.css">
</head>
<body>
    <!-- ... -->
</body>
```

## modules

### `visually-hidden`

```js
import '@substrate-system/css-util/visually-hidden'

// or minified
import '@substrate-system/css-util/min/visually-hidden'
```

Corresponds to the class `.visaully-hidden`. This is explained in the article [Accessible Icon Buttons](https://www.sarasoueidan.com/blog/accessible-icon-buttons/). It is a utility class to hide content visually while keeping it screen-reader accessible.

### `arrow`
Factor out the css for back / next arrows, so there is less duplication.

```js
import '@substrate-system/css-util/arrow'
```

#### minified
```js
import '@substrate-system/css-util/min/arrow'
```
npm package: @substrate-system/junk
Description: Filter out system junk files like .DS_Store and Thumbs.db
Author: Sindre Sorhus
Latest version: 4.0.1

# junk

> Filter out [system junk files](test.js) like `.DS_Store` and `Thumbs.db`

## fork

This is a fork of [sindresorhus/junk](https://github.com/sindresorhus/junk).

## Install

```sh
npm i -S @substrate-system/junk
```

## Usage

```js
import fs from 'node:fs/promises';
import {isNotJunk} from 'junk';

const files = await fs.readdir('some/path');

console.log(files);
//=> ['.DS_Store', 'test.jpg']

console.log(files.filter(isNotJunk));
//=> ['test.jpg']
```

## API

### isJunk(filename)

Returns `true` if `filename` matches a junk file.

### isNotJunk(filename)

Returns `true` if `filename` does not match a junk file.

### junkRegex

Regex used for matching junk files.
npm package: @substrate-system/kebab-case
Description: Kebab case, URL safe strings
Author: nichoth
Latest version: 0.0.0

# kebab case
![tests](https://github.com/substrate-system/kebab-case/actions/workflows/nodejs.yml/badge.svg)
[![types](https://img.shields.io/npm/types/@substrate-system/kebab-case?style=flat-square)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)
[![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/kebab-case)](https://packagephobia.com/result?p=@nichoth/session-cookie)
[![dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg?style=flat-square)](package.json)
[![license](https://img.shields.io/badge/license-Polyform_Non_commercial-26bc71)](LICENSE)


Kebab case a string.

```js
import { kebabCase } from '@substrate-system/kebab-case'

kebabCase('the quick brown fox');  // 'the-quick-brown-fox'
kebabCase('the-quick-brown-fox');  // 'the-quick-brown-fox'
kebabCase('the_quick_brown_fox');  // 'the-quick-brown-fox'
kebabCase('theQuickBrownFox');  // 'the-quick-brown-fox'
kebabCase('theQuickBrown Fox');  // 'the-quick-brown-fox'
kebabCase('thequickbrownfox');  // 'thequickbrownfox'
kebabCase('the - quick * brown# fox');  // 'the-quick-brown-fox'
kebabCase('theQUICKBrownFox');  // 'the-quick-brown-fox'
```

<details><summary><h2>Contents</h2></summary>

<!-- toc -->

- [install](#install)
- [API](#api)
  * [ESM](#esm)
  * [Common JS](#common-js)
  * [pre-built JS](#pre-built-js)
- [use](#use)
  * [example](#example)

<!-- tocstop -->

</details>

## install

```sh
npm i -S @substrate-system/kebab-case
```

## API
This exposes ESM and common JS via [package.json `exports` field](https://nodejs.org/api/packages.html#exports).

### ESM
```js
import '@substrate-system/kebab-case'
```

### Common JS
```js
require('@substrate-system/kebab-case')
```

### pre-built JS
This package exposes minified JS files too. Copy them to a location that is
accessible to your web server, then link to them in HTML.

#### copy
```sh
cp ./node_modules/@substrate-system/kebab-case/dist/module.min.js ./public
```

#### HTML
```html
<script type="module" src="./module.min.js"></script>
```

## use
Take a string in any format, return a URL-safe kebab case string.

### example
```js
import { kebabCase } from '@substrate-system/kebab-case'

kebabCase('the quick brown fox');  // 'the-quick-brown-fox'
kebabCase('the-quick-brown-fox');  // 'the-quick-brown-fox'
kebabCase('the_quick_brown_fox');  // 'the-quick-brown-fox'
kebabCase('theQuickBrownFox');  // 'the-quick-brown-fox'
kebabCase('theQuickBrown Fox');  // 'the-quick-brown-fox'
kebabCase('thequickbrownfox');  // 'thequickbrownfox'
kebabCase('the - quick * brown# fox');  // 'the-quick-brown-fox'
kebabCase('theQUICKBrownFox');  // 'the-quick-brown-fox'
```
npm package: @substrate-system/one-webcrypto
Description: Import the webcrypto API as a single module in both nodejs and browsers.
Author: Philipp Krüger
Latest version: 1.1.5

# one-webcrypto

The [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is available in [most browsers](https://caniuse.com/cryptography), under a global variable:

```js
// in web pages
const webcrypto = window.crypto
// in web workers, etc.
const webcrypto = self.crypto
// or generally under
const webcrypto = globalThis.crypto
```

It is also [available in NodeJS](https://nodejs.org/api/webcrypto.html#webcrypto_web_crypto_api) since version 15.

However, it is accessed differently:

```js
// in node with commonjs
const webcrypto = require("crypto").webcrypto
// in node with ES Modules
import crypto from "crypto"
const webcrypto = crypto.webcrypto
```

These different ways of getting access to valuable cryptographic primitives (see `webcrypto.subtle`) accross platforms (node & browsers) are hard to get right.

## fork

This is functionally equivalent to [fission/one-webcrypto](https://github.com/fission-codes/one-webcrypto)

## install

```sh
npm i -S @bicycle-codes/one-webcrypto
```

## Usage

With this package, you can just import the [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) like so:

```js
import { webcrypto } from "@bicycle-codes/one-webcrypto"

webcrypto.getRandomValues( //...
await webcrypto.subtle.generateKey( //...
```

Or with CommonJS:

```js
const { webcrypto } = require("@bicycle-codes/one-webcrypto")
```


## Compatibility Issues

This package uses a fairly new package.json standard field, the `exports` field.

Read more about it:
* ["export maps" in nodejs documentation](https://nodejs.org/api/packages.html#packages_package_entry_points). 
* ["package exports" in webpack documentation](https://webpack.js.org/guides/package-exports/)
* [original "pkg exports" proposal](https://github.com/jkrems/proposal-pkg-exports/)

We're also making use of webpack's pseudo-standard of the ["browser" flag](https://webpack.js.org/guides/package-exports/#target-environment) for imports.

So if your environment doesn't support that, it _may_ or _may not_ work.

We know that this setup works (*should work*) with
* NodeJS 15+ (thus also e.g. mocha)
* ESBuild
* Webpack 5
* Vite
* SvelteKit
* Snowpack
* Parcel 2

We know that this setup can have issues with
* Create React App

If you have **any experience** (whether it supports the claims above or not), **please create an issue**.
The idea is to help each other out in these crazy bundler times and document what works and what doesn't. :)
npm package: @substrate-system/path
Description: the path module from node
Author: James Halliday
Latest version: 1.0.10

# path
![tests](https://github.com/substrate-system/path/actions/workflows/nodejs.yml/badge.svg)
[![types](https://img.shields.io/npm/types/@substrate-system/path?style=flat-square)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)
[![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/path)](https://packagephobia.com/result?p=@substrate-system/path)
[![dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg?style=flat-square)](package.json)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

The `path` module from Node.js, but agnostic about runtime.

>
> [!WARNING]  
> This implements [POSIX](https://en.wikipedia.org/wiki/POSIX) style paths only, not windows.
>

<details><summary><h2>Contents</h2></summary>

<!-- toc -->

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [License](#license)

<!-- tocstop -->

</details>

## Install

```sh
npm i -S @substrate-system/path
```

## Usage

```javascript
import { path } from '@susbtrate-system/path'

const filename = 'logo.png';
const logo = path.join('./assets/img', filename);
// => './assets/img/logo.png'
document.querySelector('#logo').src = logo;
```

## API

See the [Node.js path docs][path]. `@substrate-system/path` currently matches the Node.js 10.3 API. `@substrate-system/path` only implements the POSIX functions, not the win32 ones.

## License

[MIT](./LICENSE)

[path]: https://nodejs.org/api/path.html
npm package: @substrate-system/radio-input
Description: Radio input with style
Author: nichoth
Latest version: 0.0.11

# radio input
![tests](https://github.com/substrate-system/radio-input/actions/workflows/nodejs.yml/badge.svg)
[![types](https://img.shields.io/npm/types/@substrate-system/radio-input?style=flat-square)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![install size](https://packagephobia.com/badge?p=@substrate-system/radio-input)](https://packagephobia.com/result?p=@substrate-system/radio-input)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Radio inputs with some style. [See a live demo](https://substrate-system.github.io/radio-input/)

<!-- toc -->

- [install](#install)
- [API](#api)
  * [ESM](#esm)
  * [attributes](#attributes)
- [CSS](#css)
  * [Import CSS](#import-css)
  * [CSS variables](#css-variables)
- [Example](#example)
  * [HTML](#html)
  * [pre-built](#pre-built)

<!-- tocstop -->

## install

```sh
npm i -S @substrate-system/radio-input
```

## API

This exposes ESM and common JS via [package.json `exports` field](https://nodejs.org/api/packages.html#exports). Just import the package, then use the tag, `<radio-input>`, in HTML.

### ESM
```js
import '@substrate-system/radio-input'
import '@substrate-system/radio-input/css'
// or minified CSS
import '@substrate-system/radio-input/css/min'
```

### attributes

In addition to standard `input[type=radio]` attributes, you can pass in the following

#### `label`
Pass in some text to use as the label element.

## CSS

### Import CSS

```js
import '@substrate-system/radio-input/css'
```

Or minified:
```js
import '@substrate-system/radio-input/css/min'
```

### CSS variables
Override these to customize

```css
radio-input {
    --form-control-color: #4281CB;
}
```

## Example
This calls the global function `customElements.define`. Just import, then use
the tag in your HTML.

```js
import '@substrate-system/radio-input'
import '@substrate-system/radio-input/css'
```

### HTML
```html
<form>
    <radio-input
        name="example"
        value="example1"
        label="example one"
    ></radio-input>
    <radio-input
        name="example"
        value="example2"
        label="example two"
    ></radio-input>

    <button type="submit">submit</button>
</form>
```

### pre-built
This package exposes minified JS and CSS files too. Copy them to a location that is
accessible to your web server, then link to them in HTML.

#### copy
```sh
cp ./node_modules/@substrate-system/radio-input/dist/index.min.js ./public/radio-input.min.js
cp ./node_modules/@substrate-system/radio-input/dist/style.min.css ./public/radio-input.min.css
```

#### HTML
```html
<head>
    <link rel="stylesheet" href="./radio-input.min.css">
</head>
<body>
    <!-- ... -->
    <script type="module" src="./radio-input.min.js"></script>
</body>
```
npm package: @substrate-system/stringify
Description: Create small base64-encoded strings.
Author: nichoth
Latest version: 0.0.1

# stringify
[![tests](https://img.shields.io/github/actions/workflow/status/substrate-system/stringify/nodejs.yml?style=flat-square)](https://github.com/substrate-system/stringify/actions/workflows/nodejs.yml)
[![types](https://img.shields.io/npm/types/@substrate-system/stringify?style=flat-square)](README.md)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)
[![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/stringify)](https://packagephobia.com/result?p=@substrate-system/stringify)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Create a small base64-encoded string representation of an image.

## install

```sh
npm i -D @substrate-system/stringify
```

## use

This writes to `stdout`. Use shell redirection to write to a file, etc.

### text file

```sh
npx stringify ./my-file.jpeg > base64.txt
```

### clipboard

On macos, this will copy the output to the OS clipboard

```sh
npx stringify ./my-file.jpeg | pbcopy
```
npm package: @substrate-system/throughput
Description: Speed measurment
Author: ThaUnknown
Latest version: 1.0.4

# throughput
![tests](https://github.com/substrate-system/throughput/actions/workflows/nodejs.yml/badge.svg)
[![types](https://img.shields.io/npm/types/@substrate-system/throughput?style=flat-square)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)
[![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/throughput)](https://packagephobia.com/result?p=@substrate-system/throughput)
[![dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg?style=flat-square)](package.json)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Speed measurement

## Contents

<!-- toc -->

- [fork](#fork)
- [install](#install)
- [Usage](#usage)
- [License](#license)

<!-- tocstop -->

## fork

This is a fork of [ThaUnknown/throughput](https://github.com/ThaUnknown/throughput/).

## install

```sh
npm i -S @substrate-system/throughput
```

## Usage
Import as normal.

``` js
import { throughput } from '@substrate-system/throughput'
import fs from 'node:fs'

// Let's measure how fast we can read from /dev/urandom
const speed = throughput()
const stream = fs.createReadStream('/dev/urandom')

stream.on('data', function (data) {
  // Simply call speed with the amount of bytes transferred
  const bytesPerSecond = speed(data.length)

  console.log(bytesPerSecond + ' bytes/second')
})
```

You can always get the current speed by calling `speed()`.

Per default `throughput` uses a 5 second buffer.
To change this simply pass another value to the constructor

```js
const speed = throughput(20)  // use a 20s buffer instead
```

This is an improved version of [speedometer](https://github.com/mafintosh/speedometer) by [@mafintosh](https://github.com/mafintosh/), which used timeouts, which cause a lot of issues.

## License

MIT
npm package: @substrate-system/uint8-util
Description: Fastest possible buffer-like utilities for uint8.
Author: ThaUnknown
Latest version: 2.2.22

# Uint8 Utilities
[![types](https://img.shields.io/npm/types/@substrate-system/uint8-util?style=flat-square)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)
[![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/uint8-util)](https://packagephobia.com/result?p=@substrate-system/uint8-util)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

This libraries brings features from Node's `Buffer` to JS's Uint8Arrays and in some cases other Typed Arrays, in the fastest ways possible, often faster than Node's own `Buffer`'s methods.

## Contents

<!-- toc -->

- [install](#install)
- [Usage](#usage)

<!-- tocstop -->

</details>

## install

```sh
npm i -S @substrate-system/uint8-util
```

## Usage

```js
import {
    arr2text,
    text2arr,
    arr2hex,
    hex2arr,
    arr2base,
    base2arr
} from '@substrate-system/uint8-util'

const str = arr2text(new Uint8Array([1, 2, 3]))

const uint8 = text2arr('uflnpq')

const hexString = arr2hex(new Uint8Array([1, 2, 3]))

const uint8 = hex2arr('abc')

const base64String = arr2base(new Uint8Array([89, 87, 74, 106, 77, 84, 73]))

const uint8 = base2arr('YWJjMTI')

import { concat, equal, hash, randomBytes } from '@substrate-system/uint8-util'

const joined = concat([[1,2,3], new Uint8Array([1, 2, 3])])

const same = equal([1,2,3], [1,2,3])

const hash = await hash('mystring')

const hash = await hash(new Uint8Array([1, 2, 3]))

const rand = arr2hex(randomBytes(128))
npm package: @substrate-system/vite-plugin-externalize-deps
Description: A configurable Vite plugin to help externalize your dependencies (includes subpaths)
Author: David Myers
Latest version: 0.8.0

# vite-plugin-externalize-deps

A configurable Vite plugin to help externalize your dependencies (including [subpaths](https://nodejs.org/api/packages.html#subpath-patterns)).

## Getting Started

Install the package as a dev dependency.

```sh
# npm
npm install --save-dev vite-plugin-externalize-deps

# pnpm
pnpm install --save-dev vite-plugin-externalize-deps

# yarn
yarn add --dev vite-plugin-externalize-deps
```

Add the plugin to your `vite.config.ts` file.

```ts
import { defineConfig } from 'vite'
import { externalizeDeps } from 'vite-plugin-externalize-deps'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    externalizeDeps(),
  ],
})
```

### Configuration

Pass an object to `externalizeDeps` to override the default configuration.

```ts
// These are the default values.
externalizeDeps({
  deps: true,
  devDeps: false,
  except: [],
  nodeBuiltins: true,
  optionalDeps: true,
  peerDeps: true,
  useFile: join(process.cwd(), 'package.json'),
})
```

To _include_ specific dependencies in your bundle, you can add exceptions with the `except` option.

```ts
externalizeDeps({
  except: [
    // Match exact values with strings.
    '@some/obscure/dependency',
    // Or match patterns with regular expressions.
    /^@some\/obscure(?:\/.+)?$/,
  ],
})
```
npm package: @substrate-system/webtorrent-fixtures
Description: Sample torrent files for the WebTorrent test suite
Author: WebTorrent, LLC
Latest version: 2.0.12

# webtorrent-fixtures
![tests](https://github.com/substrate-system/webtorrent-fixtures/actions/workflows/nodejs.yml/badge.svg)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
[![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/webtorrent-fixtures?cache-control=no-cache)](https://packagephobia.com/result?p=@substrate-system/webtorrent-fixtures)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

<details><summary><h2>Contents</h2></summary>
<!-- toc -->
</details>

## Sample torrent files for the WebTorrent test suite

Torrent and content test files. All files are Public Domain or Creative Commons.

## install

```sh
npm i -S @substrate-system/webtorrent-fixtures
```

## Usage

```js
import fixtures from '@substrate-system/webtorrent-fixtures'
console.log(fixtures.leaves)
```

## Inline
If you need to bundle your test files, use the inline version. Buffers are exposed as base64 strings.

```js
import fixtures from '@substrate-system/webtorrent-fixtures/inline'
```

### revive
To parse the JSON string, use the `revive` function. This will convert all `base64` string to Buffer objects.

```js
import base64Fixtures, { 
    revive
} from '@substrate-system/webtorrent-fixtures/inline'

const torrent = revive(base64Fixtures.leaves.parsedTorrent)
```

## License

MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org) and [WebTorrent, LLC](https://webtorrent.io).