open-index/open-npm huggingface dataset:
npm package: @immutabl3/location
Description: centralize the routes in your SPA
Author: Immutable, LLC
Latest version: 1.0.1

# location

`location` is a small (`2.55KB` minified, `1.14KB` gzipped), functional wrapper around 
[`url-pattern`](https://www.npmjs.com/package/url-pattern) and [`query-string`](https://www.npmjs.com/package/query-string) 
to make working with urls in SPAs easier and more DRY

## Installation

`$ npm i @immutabl3/location`

## Usage

`location` takes a url, using express-style tokenization and returns 
a function that can be used to format the url:

```js
import location from '@immutabl3/location';

const userLocation = location('/users/:name');

console.log(userLocation.get());
// > '/users/:name'

const url = userLocation({ name: 'me' });
console.log(url);
// > '/users/me'
```

Query strings can be added to the url as well:

```js
const queryiedUserLocation = userLocation.query({ hello: 'world' });
const url = queryiedUserLocation({ name: 'me' });
console.log(url);
// > '/users/me?hello=world'
```

The location also exposes a `match` method for testing the url. This is a direct proxy to 
[`url-pattern`'s match](https://www.npmjs.com/package/url-pattern):

```js
userLocation.match('/users/you'); // { name: 'you' }
```

A `locations` helper function is also available to create multiple named locations. Each 
value will be converted to a `location` instance:

```js
import { locations } from '@immutabl3/location';

const locationsMap = locations({
	home: '/home',
	admin: '/admin/:scope',
	exit: '/logout',
});
```

## Tests

Clone the repo, then:

1. `npm install`
1. `npm test`

## License

The MIT License (MIT)

Copyright (c) 2018 Immutable, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
npm package: @immutabl3/lz-string
Description: LZ-based compression algorithm
Author: Immutable, LLC
Latest version: 0.0.1

lz-string
=========

LZ-based compression algorithm

A esmodule port of [pieroxy/lz-string](https://github.com/pieroxy/lz-string/blob/master/README.md) with a ton of (benchmarked) optimizations and a smaller file size

## Install via [npm](https://npmjs.org/)

```shell
$ npm install @immutabl3/lz-string
```

## Home page

Home page for this program with examples, documentation and a live demo: http://pieroxy.net/blog/pages/lz-string/index.html

## Benchmark

```
lz-string: compress x 374 ops/sec ±1.20% (82 runs sampled)
@immutabl3/lz-string: compress x 411 ops/sec ±1.40% (83 runs sampled)
lz-string: decompress x 1,419 ops/sec ±0.21% (96 runs sampled)
@immutabl3/lz-string: decompress x 83,761,295 ops/sec ±0.26% (97 runs sampled)
```

### Library Size

As of version `0.0.1` the payload added to your app is rather small. Served using gzip compression, lz-string will add less than `1k` to your total bundle size:

<dl>
  <dt>minified</dt><dd>`~3.2kB`</dd>
  <dt>gzipped</dt><dd>`~0.9kB`</dd>
  <dt>brotli'd</dt><dd>`~0.8kB`</dd>
</dl>

# License

[MIT](https://github.com/immutabl3/lz-string/blob/master/LICENSE)
npm package: @immutabl3/mini-forage
Description: a small, indexdb key-value store with a localStorage API
Author: Joseph Clay
Latest version: 2.0.0

# mini-forage

mini-forage is a fast and simple storage library for indexeddb
with an asyncronous localStorage-esque API

### Install

```bash
npm install @immutabl3/mini-forage
```

## How to use

### Async

Because miniforage uses async storage, all methods return an promise.
It's otherwise exactly the same as the
[localStorage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage).

```js
import miniforage from '@immutabl3/mini-forage';

await miniforage.setItem('key', 'value');

const result = await miniforage.getItem('key');
// result === 'value'
```

### Storing Blobs, TypedArrays, and other JS objects

You can store JSON, ArrayBuffers, Blobs and TypedArrays in miniforage. miniforage
automatically `JSON.parse()` and `JSON.stringify()` values when getting/setting

## Multiple instances

You can create multiple instances of miniforage that point to different stores

``` javascript
import { MiniForage } from '@immutabl3/mini-forage';
const store = MiniForage({
  name: "nameHere"
});

const otherStore = MiniForage({
  name: "otherName"
});

// Setting the key on one of these doesn't affect the other.
store.setItem('key', 'value');
otherStore.setItem('key', 'value2');
```

### Library Size
As of version `1.0.0` the payload added to your app is rather small. Served using gzip compression, miniforage will add less than `1.5k` to your total bundle size:

<dl>
  <dt>minified</dt><dd>`~3.9kB`</dd>
  <dt>gzipped</dt><dd>`~1.3kB`</dd>
  <dt>brotli'd</dt><dd>`~1.1kB`</dd>
</dl>

# License

[MIT](https://github.com/immutabl3/mini-forage/blob/master/LICENSE)å
npm package: @immutabl3/random-token
Description: generates a base-64, url-safe token
Author: JosephClay
Latest version: 0.0.3

# random-token

`npm install @immutabl3/random-token`

Generates a base64, url-safe token. Uses `-`, `_`, `0-9`, `a-z`, and `A-Z`.

# Usage

```js
const randomToken = require('@immutabl3/random-token');
const token = randomToken(); // '0XjaS_7F'
```

# API

### `token([n=8])`

Generates a token. Defaults to a length of 8.

#### Arguments

`[n=8]` *(number)*: the length of the token

#### Returns

*(string)*: Returns the token


### `.valid(token, [n])`

Validates a token string. Pass optional `length` to validate the length of the token as well.

#### Arguments

`[token]` *(string)*: the token to validate
`[n]` *(number)*: the length of the token


#### Returns

*(boolean)*: Returns `true` is the token is valid


### `.characters`

The string of characters used to generate then token. Use as a reference only. Changing this string will not change token generation.

# Tests

To run tests, download the repo and run:

- `npm install`
- `npm test`

# License

MIT