open-index/open-npm huggingface dataset:
npm package: @jridgewell/build-mapping
Description: Build source and source maps
Author: Justin Ridgewell
Latest version: 0.2.1

# @jridgewell/build-mapping

> Build source and source maps

Allows you to iteratively build source code and source maps from previously generated code/maps.

## Installation

```sh
npm install @jridgewell/build-mapping
```

## Usage

```typescript
import { build, unnormalizedBuild } from '@jridgewell/build-mapping';

const input = transformFileSync('input.js')
const { code, map } = build`foo ${input} bar`;

assert.equal(code, `foo [input's code here…] bar`);
assert.deepEqual(map, {
  version: 3,
  sections: [
    { offset: { line: 0, column: 4 }, map: … },
    { offset: { line: 0, column: 24 }, map: … },
  ]
});


// If you're using @jridgewell/trace-mapping's `AnyMap`, you can use a faster unnormalized builder:
const { code: sameCode, map: unnormalized } = unnormalizedBuild`foo ${input} bar`;



// This can be anything that generates { code, map }.
function transformFileSync(file: string): { code: string, map: string } {
  return babel.transformFileSync('input.js');
}
```
npm package: @jridgewell/minx
Description: A completely static site generator powered by JS+JSX
Author: Justin Ridgewell
Latest version: 0.1.1

# @jridgewell/minx

> A completely static site generator powered by JS+JSX

Static website generators are far too complicated. I don't want to learn
how to configure the site to get it running, I just want to write basic
HTML. But, then I want to avoid duplicate a bunch code when I reuse a
section. If only there were a way to program in JS and build static
HTML…

Minx gives you the full power of JS to create a completely static site.
Each file needs to export just a `default` function in ESM, and its
return value will be interpreted as Preact JSX and used to generate your
HTML.

```jsx
// website/index.mjs

export default function Website() {
  return <html>
    <body>
      Hello World!
    </body>
  </html>;
}
```

## Installation

```bash
$ npm install -g @jridgewell/minx
```

## Usage

Basic usage is as follows:

```bash
$ minx build [--in <dir>] [--out <dir>]

$ minx serve [--in <dir>] [--port <port>]
```

See each command's help message for full options.
npm package: @jridgewell/path-sorter
Description: Sort paths, giving precedence to sibling, descendant, then parent directories
Author: Justin Ridgewell
Latest version: 0.0.1

# @jridgewell/path-sorter

> Sort paths, giving precedence to sibling, descendant, then parent directories

## Installation

```sh
npm install @jridgewell/path-sorter
```

## Usage

```js
import pathSorter from '@jridgewell/path-sorter';

const paths = [
  '../foo/baz',
  '../bar/baz',
  '../foo',
  '../bar',
  './foo/baz',
  './bar/baz',
  './foo',
  './bar',
  'foo',
  'bar',
];

const sorted = paths.sort(pathSorter);
assert.deepEqual(sorted, [
  // Non-relative paths are prioritized first
  'bar',
  'foo',

  // relative siblings paths are next, giving precedence
  // _this_ directory, then 1-deep, then 2-deep, etc.
  './bar',
  './foo',
  './bar/baz',
  './foo/baz',

  // parent directories are last,
  '../bar',
  '../foo',
  '../bar/baz',
  '../foo/baz',
]);
```
npm package: @jridgewell/resolve-uri
Description: Resolve a URI relative to an optional base URI
Author: Justin Ridgewell
Latest version: 3.1.2

# @jridgewell/resolve-uri

> Resolve a URI relative to an optional base URI

Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths.

## Installation

```sh
npm install @jridgewell/resolve-uri
```

## Usage

```typescript
function resolve(input: string, base?: string): string;
```

```js
import resolve from '@jridgewell/resolve-uri';

resolve('foo', 'https://example.com'); // => 'https://example.com/foo'
```

| Input                 | Base                    | Resolution                     | Explanation                                                  |
|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------|
| `https://example.com` | _any_                   | `https://example.com/`         | Input is normalized only                                     |
| `//example.com`       | `https://base.com/`     | `https://example.com/`         | Input inherits the base's protocol                           |
| `//example.com`       | _rest_                  | `//example.com/`               | Input is normalized only                                     |
| `/example`            | `https://base.com/`     | `https://base.com/example`     | Input inherits the base's origin                             |
| `/example`            | `//base.com/`           | `//base.com/example`           | Input inherits the base's host and remains protocol relative |
| `/example`            | _rest_                  | `/example`                     | Input is normalized only                                     |
| `example`             | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base                                |
| `example`             | `https://base.com/file` | `https://base.com/example`     | Input is joined with the base without its file               |
| `example`             | `//base.com/dir/`       | `//base.com/dir/example`       | Input is joined with the base's last directory               |
| `example`             | `//base.com/file`       | `//base.com/example`           | Input is joined with the base without its file               |
| `example`             | `/base/dir/`            | `/base/dir/example`            | Input is joined with the base's last directory               |
| `example`             | `/base/file`            | `/base/example`                | Input is joined with the base without its file               |
| `example`             | `base/dir/`             | `base/dir/example`             | Input is joined with the base's last directory               |
| `example`             | `base/file`             | `base/example`                 | Input is joined with the base without its file               |
npm package: @jridgewell/set-array
Description: Like a Set, but provides the index of the `key` in the backing array
Author: Justin Ridgewell
Latest version: 1.2.1

# @jridgewell/set-array

> Like a Set, but provides the index of the `key` in the backing array

This is designed to allow synchronizing a second array with the contents of the backing array, like
how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, and there
are never duplicates.

## Installation

```sh
npm install @jridgewell/set-array
```

## Usage

```js
import { SetArray, get, put, pop } from '@jridgewell/set-array';

const sa = new SetArray();

let index = put(sa, 'first');
assert.strictEqual(index, 0);

index = put(sa, 'second');
assert.strictEqual(index, 1);

assert.deepEqual(sa.array, [ 'first', 'second' ]);

index = get(sa, 'first');
assert.strictEqual(index, 0);

pop(sa);
index = get(sa, 'second');
assert.strictEqual(index, undefined);
assert.deepEqual(sa.array, [ 'first' ]);
```