open-index/open-npm huggingface dataset:
npm package: @suli-g/stratum
Description: A layered React framework for building multi-system management applications.
Author: suli-g
Latest version: 0.2.0

# Stratum

A layered React framework for building multi-system management applications.  
Define the architecture once. Generate every new system with one command.

## Setup

```bash
npm install
npm run dev
```

## Testing

```bash
yarn test          # run unit test suite
yarn test:watch    # run tests in watch mode
```

## Generator

```bash
npm run make:system <name>
```

Scaffolds a complete management system and wires it into the app automatically.

**Examples**

```bash
npm run make:system orders
npm run make:system staff
npm run make:system delivery-zone   # hyphenated → camelCase/PascalCase
```

Each run creates three files and patches three registries:

| Created | Purpose |
|---|---|
| `src/model/<name>.js` | Type definition + factory function |
| `src/store/slices/<name>.js` | Reducer + action type constants |
| `src/views/<Name>/index.jsx` | View component wired to the store |

| Patched | What changes |
|---|---|
| `src/store/reducer.js` | Import + delegation line added |
| `src/store/initialState.js` | Slice key added |
| `src/views/tabs.js` | Import + registry entry added |

The tab is live in the nav immediately. No other files change.

## Individual commands

```bash
npm run make:model  <name>   # model file only
npm run make:slice  <name>   # slice file only
npm run make:view   <name>   # view folder only
```

## Architecture

```
src/
├── util/          Pure functions. No React, no state.
├── model/         Data shapes and factory functions.
├── store/         useReducer + Context. All app state lives here.
│   └── slices/    One file per system. Generated by make:system.
└── views/         UI only. Reads store, dispatches actions.
    └── shared/    Primitive components (Btn, Field, EmptyState…)
```

**Dependency rule** — imports flow downward only:

```
views → store → model → util
```

No layer may import from a layer above it.
npm package: @sullenor/eslint-config
Description: the eslint preset of mine
Author: Alexey Litvinov
Latest version: 2.0.0

eslint-config
=============

The set of configuration files for ESLint.


## Installation

```
yarn add @sullenor/eslint-config --dev
```


## Usage

Create the `.eslintrc.js` file with the following content:

```js
'use strict';

module.exports = {
  extends: '@sullenor/eslint-config',
};
```

or add `eslintConfig` field to the `package.json`:

```json
{
  "name": "<your project>",
  "eslintConfig": {
    "extends": "@sullenor/eslint-config"
  }
}
```

In case you use es6 imports, add the following parser options:

```json
{
  "parserOptions": {
    "sourceType": "module"
  }
}
```

so it will be:

```js
'use strict';

module.exports = {
  parserOptions: {
    sourceType: 'module',
  },

  extends: '@sullenor/eslint-config',
};
```


## License

> The MIT License
npm package: @sullenor/eslint-config-partner
Description: Eslint config for PI developers
Author: Alexey Litvinov
Latest version: 1.1.2

eslint-config-partner
=====================

The set of configuration files for ESLint for our team.


## Installation

```
npm install @sullenor/eslint-config-partner
```


## Usage

### via package.json

Add to your `package.json` file:

```json
"eslintConfig": {
  "extends": "@sullenor/eslint-config-partner"
},
```

### via .eslintrc.json

Create file `.eslintrc.json` in your project directory with the following content:

```json
{
  "extends": "@sullenor/eslint-config-partner"
}
```

### Possible environments

- `react` — designed for react, flowtype and jest.
- `server` — designed for nodejs environment.
- `static` — designed for es5 mostly.

Example:

```json
{
  "extends": "@sullenor/eslint-config-partner/react"
}
```


## License

> The MIT License
npm package: @sullivan/react-inject
Description: Load and inject static assets with React
Author: Chris Sullivan
Latest version: 0.1.0

![npm version](https://img.shields.io/npm/v/@sullivan/react-inject.svg) ![npm license](https://img.shields.io/npm/l/@sullivan/react-inject.svg)

# @sullivan/react-inject
Inject asset content dynamically in React 16.8.3+. 

## Installation
```
npm install --save @sullivan/react-inject
```
or
```
yarn add @sullivan/react-inject
```


# Usage

```javascript
import React from 'react';
import ReactInject from '@sullivan/react-inject';

const Circle = (props) => (
  <ReactInject src="/asset/circle.svg" />
);

export default Circle;
```


# Props 
If an id is used, ReactInject will try to inject into the result of getElementById. If not, a new element will be created and the content will be injected there. To control the newly created element pass a tag prop. 

```typescript
type ReactInjectProps {
  id?: string,
  tag?: string,
  src: string,
}
```
 
## Changelog

### 0.1.0
- Add the ability to create a specific type of element instead of defaulting to a 'div'
npm package: @sullivan/react-virtualizer
Description: Simple pseudo virtualization and reveal components to hide off-window components
Author: Chris Sullivan
Latest version: 1.0.5

![npm version](https://img.shields.io/npm/v/@sullivan/react-virtualizer.svg) ![npm license](https://img.shields.io/npm/l/@sullivan/react-virtualizer.svg)

# @sullivan/react-virtualizer
Simple pseudo virtualization and reveal components to hide off-window components 

## Installation
```
npm install --save @sullivan/react-virtualizer
```
or
```
yarn add @sullivan/react-virtualizer
```


# Usage

## Virtual 
The `Virtual` component hides its children when it is no longer visible within the browser window. 


#### Props 

| prop     | type    | default |
|----------|---------|---------|
| tag      | string  | div     |
| style    | object  | {} |
| children | React.Children | [] |
| rootMargin | string \| number | 100px |
| initialHeight | string \| number | 100vh |
| initialWidth | string \| number | 100vw |

```javascript
import Virtual from '@sullivan/react-virtualizer';

const Item = () => (
  <Virtual tag={'p'}>
    Resource intensive component here
  </Virtual>
);
```

## Reveal
The `Reveal` component doesn't show any of its children until it is scrolled into the browser window.

#### Props 

| prop     | type    | default |
|----------|---------|---------|
| tag      | string  | div     |
| style    | object  | {} |
| children | React.Children | [] |

```javascript
import { Reveal } from '@sullivan/react-virtualizer';

const Image = ({ src }) => (
  <Reveal>
    <img src={src}>
  </Reveal>
);
```

## Performance Tweaks
If you find that the `Virtual` component is slow to load while scrolling or tends to pop-in. You can tweak the initialHeight and initialWidth to be a closer approximation to the actual content. This helps speed up sibling `Virtual` components in determining their own dimensions. 

## Compatability
React 16.8.3+
 
## Changelog

**1.0.5**
- Performance improvements, obtaining dimensions from entry instead of forcing a repaint on the component
- Adding number support for initialHeight, initialWidth, and rootMargin

**1.0.4**
- Added initialHeight and initialWidth to allow for more fine controls of item rendering

**1.0.3**
- Improved loading times

**1.0.0**
- First version published
npm package: @sullivan/slim
Description: A tiny javascript template library
Author: Chris Sullivan
Latest version: 0.0.2

![npm version](https://img.shields.io/npm/v/@sullivan/slim.svg) ![npm license](https://img.shields.io/npm/l/@sullivan/slim.svg)
# @sullivan/slim 
A very slim js template library 


## Installation

```sh
npm install @sullivan/slim --save-dev
```
or
```sh
yarn add @sullivan/slim --dev
```

## Usage

Slim can be used in two ways, as a template literal or as a function. Arguments within double brackets are processed. NOTE: whitespace will be trimmed and is not preserved. 

```
const slim = require('@sullivan/slim');

const context = {
  greeting: 'Hello',
};

slim`{{greeting}}`(context); // Hello

slim('{{greeting}}')(context); // Hello
```

### Context
The context argument MUST be an object and can contain synchronous functions. 

##### Properties
Properties are scoped to the template and anything within the double brackets will be processed as javascript. 
```
const slim = require('@sullivan/slim');

const context = {
  x: 25,
  y: 75,
};

slim('{{ x + y }}')(context); // 100
```


##### Functions
Using functions can be invoked with the context object, or within the double bracket definition. 

Example:
```
const slim = require('@sullivan/slim');

const context = {
  numbers: [1, 2, 3],
  addNumbers: (ctx) => ctx.numbers.reduce((a, i) => a + i, 0),
  add: (p1, p2) => p1 + p2,
};


const rendered = slim`
  total: {{addNumbers}}
  manual: {{ add(3, 27) }}
`(context); 
//
//  total: 6
//  manual: 30
// 
```
npm package: @sullivan/use-async
Description: Perform async operations within react
Author: Chris Sullivan
Latest version: 1.0.0

![npm version](https://img.shields.io/npm/v/@sullivan/use-async.svg) ![npm license](https://img.shields.io/npm/l/@sullivan/use-async.svg)

# @sullivan/use-async
Hook friendly asynchronous operations for React 16.8+. 

## Installation
```
npm install --save @sullivan/use-async
```
or
```
yarn add @sullivan/use-async
```


## Usage

```javascript
import React from 'react';
import { useAsync } from '@sullivan/use-async';

const Example = (props) => {
  const { loading, data, error, dispatch } = useAsync(fetch);
  
  return (
    <div onClick={() => dispatch('some_url')}>
      <h1>{loading ? 'Loading' : 'Done'}</h1>
    </div>
  );
};
```

### Options

`useAsync(fn, options?) => Response`

| Option | Description | Type |
|--|--|--|
| debounce | Milliseconds to perform a debounce, ignores if unset | number |
| memoize | If memoization should be done | boolean |


### Response

| Field | Description |
|--|--|
| loading | If the async call is occuring | 
| error | Any error that was thrown |
| data | The success result of the async call | 
| dispatch | How to invoke the async function | 



----

## Changelog 
**0.2.0**

- Removed withAsync HOC
- Added options for debounce and memoization
npm package: @sullux/bucketdb
Description: A lightweight, serverless-friendly document database library for Node.js that uses S3-compatible storage as its backing store.
Latest version: 0.2.3-next.4

# bucket-db

BucketDB is an embedded, timeshared, block-structured database that sits directly on top of object storage (like S3) or any simple key-value store. It provides immutable data structures, atomic updates, and massive scalability for reads, while handling concurrent writers via a unique Timesharing mechanism.

## Documentation

- [Mission, Vision, and Philosophy](INDEX.md)
- [Quick Start](QUICK_START.md)
- [API Reference](API.md)
- [Cluster Operations](CLUSTER.md)
- [Storage Drivers](DRIVERS.md)
- [Schema Definition](SCHEMA.md)
- [Schema Migrations](MIGRATIONS.md)
- [Batching and Writes](BATCHING.md)
- [Blobs](BLOBS.md)
- [Querying](QUERYING.md)
- [Custom Functions](FUNCTIONS.md)
- [Configuration](CONFIGURATION.md)
- [Architecture](ARCHITECTURE.md)
- [FAQ](FAQ.md)
- [Change Log](CHANGE_LOG.md)

## Internal Architecture

If you are contributing or just curious about how BucketDB works under the hood, check out the [System Architecture](architecture/SYSTEM.md) overview.

## License

BucketDB is available under the MIT License for non-commercial use. See [LICENSE](LICENSE) for details.
npm package: @sullux/fp-light-always
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-always

`npm i @sullux/fp-light-always`
[source](https://github.com/Sullux/fp-light/blob/master/lib/always/always.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/always/always.spec.js)

The always utility wraps a static value in a function. While simple as far as utilities go, it can add readability to functional code.

* [always](#always)

### always

`always<T>(value: T): T`

The following example uses `always` to return a pre-determined value from a thennable.

```javascript
const { curry } = require('@sullux/fp-light-curry')
const AWS = require('aws-sdk')

const s3 = new AWS.s3()

const saveObject = curry((key, object) =>
  s3.putObject({
    Body: JSON.stringify(object),
    Bucket: process.env.BUCKET,
    Key: key,
  }).promise().then(always(object)))
```
npm package: @sullux/fp-light-call
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.2

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-call

`npm i @sullux/fp-light-call`
[source](https://github.com/Sullux/fp-light/blob/master/lib/call/call.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/call/call.spec.js)

The purpose of the `call` helper is to allow the function to be passed as the most significant argument.

* [call](#call)

### call

`call(arg: any, fn: <T>(mixed) => T): T`

The `call` helper can be useful in functional composition. Consider the following example.

```javascript
const { call } = require('@sullux/fp-light-call')
const { get } = require('@sullux/fp-light-get')

const random0To31 = () =>
  Math.floor(Math.random() * 36)

const randomString = length =>
  Array(length)
    .fill()
    .map(random0To31)
    .map(get('toString'))
    .map(call(36))
    .join('')
```

Note that since the call utility accepts an argument first and a function second, the `.map(call(36))` sets up the call `toString(36)` for each input value. This isn't the most efficient example, but it is fully functional and serves as an example of passing a function as the most significant argument to the call utility.
npm package: @sullux/fp-light-collect
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-collect

`npm i @sullux/fp-light-collect`
[source](https://github.com/Sullux/fp-light/blob/master/lib/collect/collect.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/collect/collect.spec.js)

The collect utility creates a function that accepts _n_ arguments and passes them to the wrapped function in a single array argument.

* [collect](#collect)

### collect

`collect<T>(fn: (Array<mixed>) => T): (...args: Array<mixed>) => T`

While this utility doesn't do a complex job, it can help make some functional programming more readable as in the following example.

```javascript
const { collect } = require('@sullux/fp-light-collect')
const { reduce } = require('@sullux/fp-light-reduce')

const callInOrder = collect(reduce(
  (result, next) => next(result),
  undefined,
))

callInOrder(
  () => console.log('starting'),
  () => 40 + 2,
  value => console.log('ended with', value)
)
/*
starting
ended with 42
*/
```

This example collects functions and passes them to a pipe-like reducer.
npm package: @sullux/fp-light-concat
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-concat

`npm i @sullux/fp-light-concat`
[source](https://github.com/Sullux/fp-light/blob/master/lib/concat/concat.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/concat/concat.spec.js)

Concatenates values into a single iterable.

* [concat](#concat)

### concat

`concat(...iterables: Array<mixed>): { @@iterator(): Iterator<mixed> }`

This function does a shallow concatenation of iterables, objects and values and returns the concatenated iterable. The unit test for the concat function demonstrates how it handles various types of inputs:

```javascript
const { deepStrictEqual } = require('assert')

const { concat } = require('./concat')

const date = new Date()

describe('concat', () => {
  it('should concatenate iterables', () => deepStrictEqual(
    [...concat(
      [1, 2],
      null,
      undefined,
      { foo: 42 },
      function* () { yield 'bar' },
      date,
      concat(true, false, [3, 4]),
    )],
    [1, 2, null, undefined, ['foo', 42], 'bar', date, true, false, 3, 4]
  ))
})
```
npm package: @sullux/fp-light-curry
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-curry

`npm i @sullux/fp-light-curry`
[source](https://github.com/Sullux/fp-light/blob/master/lib/curry/curry.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/curry/curry.spec.js)

To _curry_ a function is to make it so that arguments can be progressively applied.

* [curry](#curry)

The following example demonstrates an uncurried function versus a manually curried function.

```javascript
const uncurriedAdd = (x, y) => x + y
uncurriedAdd(1, 2) // 3
uncurriedAdd(1) // NaN

const add = x => y => x + y
add(1)(2) // 3
add(1) // function
const increment = add(1)
increment(2) // 3
```

### curry

`curry(fn: Function, arity: ?Number): Function`

Returns a function that supports partial argument application. Note: the term "arity" means "number of arguments". If the `arity` is not supplied, the value of `fn.length` is used. Note that `fn.length` will not include optional or _rest_ arguments.

A vanilla example of currying:

```javascript
const add = curry((x, y) => x + y)
add(1, 2) // 3
const increment = add(1)
increment(2) // 3
```

An example showing that optional arguments are _not_ curried by default:

```javascript
// optional argument is not curried!
const mul = curry((x, y = 1) => x * y)
mul(2, 3) // 6
mul(2) // 2
```

An example using arity to explicitly curry an optional argument:

```javascript
const div = curry((x, y = 1) => x / y, 2) // note: arity 2 is explicit
div(6, 3) // 2
const half = div(2)
half(6) // 3
```
npm package: @sullux/fp-light-filter
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.2

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-filter

`npm i @sullux/fp-light-filter`
[source](https://github.com/Sullux/fp-light/blob/master/lib/filter/filter.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/filter/filter.spec.js)

The filter function works similarly to the built in `Array.prototype.filter` function except that the iterable is the most significant (last) argument.

* [filter](#filter)

### filter

`filter(test: Function, iterator: Iterator<mixed>): Iterator<mixed>`

The advantage to using iterable functions like `filter` over the built-in array functions is that the array functions create an intermediate representation where the iterable functions evaluate lazily. This leads to a lower memory footprint and faster processing in many scenarios.

This example uses the filter and map iterable functions.

```javascript
const { filter } = require('@sullux/fp-light-filter')
const { get } = require('@sullux/fp-light-get')
const { pipe } = require('@sullux/fp-light-pipe')
const { trap } = require('@sullux/fp-light-trap')
const { readFile, readdir } = require('fs')
const { promisify } = require('util')

const readAllObjects = pipe(
  promisify(readdir),
  map(get('toString')),
  map(trap(promisify(readFile))),
  filter(get(1)),
  map(get(1, 'toString')),
  map(JSON.parse),
  Promise.all,
)

module.exports = { readAllObjects }
```
npm package: @sullux/fp-light-get
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.3

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-get

`npm i @sullux/fp-light-get`
[source](https://github.com/Sullux/fp-light/blob/master/lib/get/get.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/get/get.spec.js)

The purpose of the `get` helper is to provide a functional way to retrieve properties from an input object.

* [get](#get)

### get

`get(pathParts: (string | number) | (string | number)[], source: any): any`

The `get` function is useful for traversing a property path. The path parts can be strings or numbers. This supports retrieving properties and array elements.

```javascript
const { get } = require('@sullux/fp-light-get')

const object = { foo: [41, 42] }

get(['foo', 1], object) // 42
```

The `get` helper can be useful in functional composition. The following is a more complete example of the `get`function.

```javascript
const { call } = require('@sullux/fp-light-call')
const { get } = require('@sullux/fp-light-get')

const random0To31 = () =>
  Math.floor(Math.random() * 36)

const randomString = length =>
  Array(length)
    .fill()
    .map(random0To31)
    .map(get('toString'))
    .map(call(36))
    .join('')
```
npm package: @sullux/fp-light-map
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.3

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-map

`npm i @sullux/fp-light-map`
[source](https://github.com/Sullux/fp-light/blob/master/lib/map/map.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/map/map.spec.js)

Similar to the [built-in Javascript function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) `Array.prototype.map`, but accepts the iterable as the second argument.

* [map](#map)

### map

`map(mapper, iterable)`

Given a mapping function and an iterable, returns an iterable where each input item is mapped to an output item.

```javascript
const { map } = require('@sullux/fp-light-map')

const input = [1, 2, 3]
const output = map(x => x + 1, input)
console.log([...output])
// [2, 3, 4]
```

The behavior of `map` is different from `asyncMap` in a few ways. First, the `map` function will quietly await the resolution of the prior iteration before continuing while `asyncMap` will produce a standalone promise for each iteration. Second, while `map` will only produce a promise after receiving a promise as input, `asyncMap` will return a promise for all iterations.

```javascript
const { map } = require('@sullux/fp-light-map')
const { asyncMap } = require('@sullux/fp-light-async')

const a = 1
const b = 2
const c = 3

const mapExample = () => {
  const mapped = map(v => v + 1, [Promise.resolve(a), b, c])
  
  const longhand = Promise.resolve(a)
    .then(a => a + 1)
    .then(a => [a, b + 1])
    .then([a, b] => [a, b, c + 1])
}

const asyncMapExample = () => {
  const asyncMapped = asyncMap(v => v + 1, [a, b, c]])
  
  const longhand = [
    Promise.resolve(a + 1),
    Promise.resolve(b + 1),
    Promise.resolve(c + 1),
  ]
}

```
npm package: @sullux/fp-light-memoize
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-memoize

`npm i @sullux/fp-light-memoize`
[source](https://github.com/Sullux/fp-light/blob/master/lib/memoize/memoize.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/memoize/memoize.spec.js)

Memoization is the caching of results for a given set of arguments. Memoization is useful for pure functions that have a high computational cost or asynchronous latency.

* [memoize](#memoize)
* [defaultMemoizeArgsEqual](#defaultmemoizeargsequal)

### memoize

`memoize<T>(`
  `fn: (...args: Array<any>) => T, `
  `equal: ?(leftArgs: Array<any>, rightArgs: Array<any>) => boolean`
`): T`

* `fn`: the function to memoize.
* `equal`: (default [defaultMemoizeArgsEqual](#defaultmemoizeargsequal)) the function to test equality of arguments.

When the memoized function is called, it checks to see if the given arguments have already been cached. It checks by calling `equal` for each set of cached arguments. If it finds a match, it returns the corresponding cached result; otherwise, it executes `fn` and caches and returns the result.

The built-in Node.js `require` function is a good example of a memoized function: it will load the required file the first time (incurring asynchronous latency) and will return the originally loaded value on every subsequent call. A naive implementation of an asynchronous `require` might look like this:

```javascript
const { readFile } = require('fs')
const { promisify } = require('util')
const { createContext, runInContext } = require('vm')
const { pipe } = require('@sullux/fp-light-pipe')
const { memoize } = require('@sullux/fp-light-memoize')

const readFileAsync = promisify(readFile)
  .then(data => data.toString())

const createVm = js => {
  const sandbox = {
    ...globals,
    module: { exports: {} },
  }
  const context = createContext(sandbox)
  runInContext(js, context)
  return sandbox.module.exports
}

const requireAsync = memoize(pipe(
  readFileAsync,
  createVm
))

module.exports = { requireAsync }
```

### defaultMemoizeArgsEqual

`defaultMemoizeArgsEqual(leftArgs: Array<any>, rightArgs: Array<any>): boolean`

This is the default equality test for `memoize`. This is a shallow test that compares the argument count and shallow equality of each argument using `Oject.is`. A custom implementation might choose deep equality to enable interface equality over reference equality, for example.
npm package: @sullux/fp-light-pipe
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-pipe

`npm i @sullux/fp-light-pipe`
[source](https://github.com/Sullux/fp-light/blob/master/lib/pipe/pipe.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/pipe/pipe.spec.js)

A pipe is a function comprised of a sequence of functions where the initial argument is passed to the first function, the result of that is passed to the second function and so on, and where the final result is the return value of the last function in the sequence.

* [pipe](#pipe)

### pipe

`pipe(...steps: Function[]): Function`

This is an example of a synchronous pipe:

```javascript
const productOfDouble = pipe(
  value => value + value,
  value => value * value
)

productOfDouble(3) // 36
```

And this is an example of an asynchronous pipe. This example also uses `curry`, `compose`, and the AWS SDK, and is a more practical example of the power of functional pipes.

```javascript
const { curry } = require('@sullux/fp-light-curry')
const { pipe } = require('@sullux/fp-light-pipe')
const { compose } = require('@sullux/fp-light-compose')
const AWS = require('aws-sdk')

const s3 = new AWS.s3()

const saveObject = curry((key, o) =>
  s3.putObject({
    Body: JSON.stringify(o),
    Bucket: process.env.BUCKET,
    Key: key,
  }).promise())

const readObject = key =>
  s3.getObject({
    Bucket: process.env.BUCKET,
    Key: key,
  }).promise()

const decodeObject = ({ Body }) =>
  JSON.parse(Body)

const composeWith = curry(compose, 2)

const extendObject = (key, added) =>
  pipe(
    readObject,
    decodeObject,
    composeWith(added),
    saveObject(key)
  )(key)

module.exports = {
  extendObject
}
```
npm package: @sullux/fp-light-range
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-range

`npm i @sullux/fp-light-range`
[source](https://github.com/Sullux/fp-light/blob/master/lib/range/range.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/range/range.spec.js)

Creates an iterable of integers spanning the given range. This can be a good way to functionally implement _next n items_ logic or _repeat n times_ logic.

* [range](#range)

### range

`range(start: Number, end: Number): Iterable<Number>`

Given a start less than end, iterates forward; otherwise, iterates backwards. All ranges are inclusive. The following tests illustrate the functionality.

```javascript
const { range } = require('./range')
const { deepStrictEqual } = require('assert')

describe('range', () => {
  it('should produce a low to high range', () => deepStrictEqual(
    [...range(1, 3)],
    [1, 2, 3]
  ))
  it('should produce a high to low range', () => deepStrictEqual(
    [...range(3, 1)],
    [3, 2, 1]
  ))
  it('should produce a single digit range', () => deepStrictEqual(
    [...range(1, 1)],
    [1]
  ))
})
```
...
npm package: @sullux/fp-light-reduce
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.2

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-reduce

`npm i @sullux/fp-light-reduce`
[source](https://github.com/Sullux/fp-light/blob/master/lib/reduce/reduce.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/reduce/reduce.spec.js)

Similar to the [built-in Javascript function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) `Array.prototype.reduce`, but accepts the iterable as the last argument.

* [reduce](#reduce)

### reduce

`reduce(reducer, initialState, iterable)`

Reduces an iterable to a single value by combining (reducing) the previous (or initial) state with the current value.

The reducer function has the following signature:

`reducer(state, value, index, iterable)`

* `state`: the return value of the previous iteration, or the `initialState` if this is the first iteration.
* `value`: the current value of the iteration.
* `index`: the zero-based offset of the current iteration.
* `iterable`: the original iterable being reduced.

While a reducer can technically take the above four arguments, it is rare to need more than the first two arguments.

The reduce function is one of cornerstones of functional programming. The following example turns an array of key/value pairs into an object.

```javascript
const { reduce } = require('@sullux/fp-light-reduce')

const pairs = [
  [foo: 'bar'],
  [baz: 42],
]

const composedObject = reduce(
  (object, [key, value]) => ({ ...object, [key]: value }),
  {},
  pairs,
)

console.log(composedObject)
// { foo: 'bar', baz: 42 }
```

Because the `reduce` function is async aware, promises are resolved between calls to the reducer. This makes the reduce function an ideal implementation of the classic _waterfall_ pattern.
npm package: @sullux/fp-light-resolve
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.2

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-resolve

`npm i @sullux/fp-light-resolve`  
[source](https://github.com/Sullux/fp-light/blob/master/lib/resolve/resolve.js)  
[test](https://github.com/Sullux/fp-light/blob/master/lib/resolve/resolve.spec.js)

Deeply resolves all functions and promises.

* [resolve](#resolve)

### resolve

`resolve(target, input)`

Resolution involves passing the input to the target (if a function) or to any function found on the target (if an object or iterable). If any literal or resolved value anywhere in the result is a thenable, or if the input is a thennable, the return value of `resolve` is a promise; otherwise, the return value is the target after having been fully-resolved with the input.

```javascript
resolve('foo', 42) // 'foo'
resolve(x => x + 1, 42) // 43
resolve(['foo', x => x + 1], 42) // ['foo', 43]
resolve({ foo: 'bar', baz: x => x + 1 }, 42) // { foo: 'bar', baz: 43 }

resolve(x => x + 1, Promise.resolve(42))
  // promise -> 42

resolve({ foo: 'bar', baz: x => Promise.resolve(x + 1) }, 42)
  // promise -> { foo: 'bar', baz: 43 }

resolve(
  {
    foo: Promise.resolve('bar'),
    baz: Promise.resolve(x => Promise.resolve(x + 1))
  },
  Promise.resolve(42)
)
  // promise -> { foo: 'bar', baz: 43 }
```
npm package: @sullux/fp-light-skip
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-skip

`npm i @sullux/fp-light-skip`
[source](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.spec.js)

Creates an iterable that skips the first _n_ items of the given iterable.

* [skip](#skip)

### skip

`skip<T>(count: number, iterable: Iterable<T>): Iterable<T>`

If `count` is less than 1, yields all items; otherwise, skips `count` items. If count is greater than the number of items in the iterable, returns an empty iterable.

```javascript
const { skip } = require('./skip')
const { deepStrictEqual } = require('assert')

describe('skip', () => {
  it('should skip zero', () => deepStrictEqual(
    [...skip(0, [1, 2, 3])],
    [1, 2, 3]
  ))
  it('should skip zero with negative skip', () => deepStrictEqual(
    [...skip(-1, [1, 2, 3])],
    [1, 2, 3]
  ))
  it('should skip n values', () => deepStrictEqual(
    [...skip(1, [1, 2, 3])],
    [2, 3]
  ))
  it('should return empty skipping length', () => deepStrictEqual(
    [...skip(3, [1, 2, 3])],
    []
  ))
  it('should return empty skipping greater than length', () => deepStrictEqual(
    [...skip(4, [1, 2, 3])],
    []
  ))
})
```
npm package: @sullux/fp-light-slice
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-skip

`npm i @sullux/fp-light-skip`
[source](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.spec.js)

Creates an iterable that starts at the _start_ item and ends at the _end_ item (inclusive) of the given iterable.

* [skip](#skip)

### skip

`slice<T>(start: number, end: number, iterable: Iterable<T>): Iterable<T>`

If `start` is less than 1, begins at the first item; otherwise, begins at the one-based start item. If end is greater than the number of items in the iterable, returns through the last item; otherwise, returns through the end item (inclusive).

NOTE: since `slice` is a count-based operation, all offsets are 1-based.

```javascript
const { slice } = require('./slice')
const { deepStrictEqual } = require('assert')

describe('slice', () => {
  it('should return empty when end = begin', () => deepStrictEqual(
    [...slice(2, 2, [1, 2, 3])],
    []
  ))
  it('should return empty when end > begin', () => deepStrictEqual(
    [...slice(3, 2, [1, 2, 3])],
    []
  ))
  it('should return first element when start < 1', () => deepStrictEqual(
    [...slice(-1, 3, [1, 2, 3])],
    [1, 2]
  ))
  it('should return last element when end > length', () => deepStrictEqual(
    [...slice(2, 5, [1, 2, 3])],
    [2, 3]
  ))
  it('should return a slice', () => deepStrictEqual(
    [...slice(2, 4, [1, 2, 3, 4])],
    [2, 3]
  ))
})
```
npm package: @sullux/fp-light-spread
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-spread

`npm i @sullux/fp-light-spread`
[source](https://github.com/Sullux/fp-light/blob/master/lib/spread/spread.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/spread/spread.spec.js)

The spread utility creates a function that accepts an array and spreads the array elements as arguments to the wrapped function.

* [spread](#spread)

### spread

`spread<T>(fn: (...Array<mixed>) => T): (args: Array<mixed>) => T`

While this utility doesn't do a complex job, it can help make some functional programming more readable as in the following example.

```javascript
const { pipe } = require('@sullux/fp-light-pipe')
const { range } = require('@sullux/fp-light-range')
const { spread } = require('@sullux/fp-light-spread')

const print1ToN = pipe(
  range(1),
  spread(console.log)
)

print1ToN(5)
// 1 2 3 4 5
```
npm package: @sullux/fp-light-take
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-skip

`npm i @sullux/fp-light-skip`
[source](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/skip/skip.spec.js)

Creates an iterable that takes the first _n_ items of the given iterable.

* [skip](#skip)

### skip

`skip<T>(count: number, iterable: Iterable<T>): Iterable<T>`

If `count` is less than 1, yields no items; otherwise, yields `count` items. If count is greater than the number of items in the iterable, yields all items.

```javascript
const { take } = require('./take')
const { deepStrictEqual } = require('assert')

describe('take', () => {
  it('should take all values when given length', () => deepStrictEqual(
    [...take(3, [1, 2, 3])],
    [1, 2, 3]
  ))
  it('should take all values when given greater than length', () => deepStrictEqual(
    [...take(4, [1, 2, 3])],
    [1, 2, 3]
  ))
  it('should take some values when given less than length', () => deepStrictEqual(
    [...take(2, [1, 2, 3])],
    [1, 2]
  ))
  it('should return empty when given zero', () => deepStrictEqual(
    [...take(0, [1, 2, 3])],
    []
  ))
  it('should return empty when given less than zero', () => deepStrictEqual(
    [...take(-1, [1, 2, 3])],
    []
  ))
})
```
npm package: @sullux/fp-light-tap
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.2

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-tap

`npm i @sullux/fp-light-tap`  
[source](https://github.com/Sullux/fp-light/blob/master/lib/tap/tap.js)  
[test](https://github.com/Sullux/fp-light/blob/master/lib/tap/tap.spec.js)  

A tap is a function that wraps a side-effect such that the return value of the tap is always the same as the input value.

* [tap](#tap)

### tap

`tap<T>((aside: any) => T): (T) => T`

Aliases: `aside`, `dispatch`

Creates a function that calls the wrapped function but always returns the original argument. The return value of the wrapped function is ignored. NOTE: if the return value of the wrapped function is thennable, `tap` will return a promise that awaits the thennable and resolves to the original value.

```javascript
const { tap } = require('@sullux/fp-light-tap')
const { strictEqual } = require('assert')

describe('tap', () => {
  it('should call the wrapped function', () => {
    let mutable
    tap(v => { mutable = v })(42)
    strictEqual(mutable, 42)
  })
  it('should return the input value', () =>
    strictEqual(tap(() => 7)(42), 42))
  it('should return a promise resolving to the input value', () =>
    tap(v => Promise.resolve(7))(42)
      .then(v => strictEqual(v, 42)))
})
```

Or a somewhat practical example of an `s3Bucket` implementation with a `putObject` function:

```javascript
const { curry } = require('@sullux/fp-light-curry')
const { tap } = require('@sullux/fp-light-tap')
const { pipe } = require('@sullux/fp-light-pipe')

const s3 = new (require('aws-sdk')).S3

const putObjectParams = curry((bucket, { key, data }) => ({
  Bucket: bucket,
  Key: key,
  Data: JSON.stringify(data),
}))

const putObject = params => 
  s3.putObject(params).promise()

const s3Bucket = (bucket) => ({
  putObject: pipe(
    putObjectParams(bucket),
    tap(console.log),
    putObject,
    tap(console.log),
  ),
})
```
npm package: @sullux/fp-light-to-array
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-to-array

`npm i @sullux/fp-light-to-array`  
[source](https://github.com/Sullux/fp-light/blob/master/lib/to-array/to-array.js)  
[test](https://github.com/Sullux/fp-light/blob/master/lib/to-array/to-array.spec.js)  

Produces an array from any input.

* [toArray](#toarray)

### toArray

`toArray(any)`

If the input is already an array, the original input is returned. If the input is iterable, it is spread into a new array. The values `null`, `undefined` and `''` (empty string) produce an empty array. A `Date`, `function` or `number` value is returned in a single-element array, while objects return an array of entries (as from `Object.entries`).

```javascript
const { toArray } = require('@sullux/fp-light-to-array')

toArray() // []

toArray(null) // []

toArray('') // []

toArray('foo') // ['f', 'o', 'o']

toArray(42) // [42]

toArray(new Date()) // [Date: 2019-03-01T14:56:53.812Z]

toArray(() => 42) // { Function: [Function] }

toArray({ foo: 42, bar: 'baz' }) // [['foo', 42], ['bar', 'baz']]
```
npm package: @sullux/fp-light-to-object
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-to-object

`npm i @sullux/fp-light-to-object`
[source](https://github.com/Sullux/fp-light/blob/master/lib/toObject/toObject.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/toObject/toObject.spec.js)

Produces an object from any input. If the input is iterable, the object is assembled from the given key/value pairs.

* [toObject](#toobject)

### toObject

`toObject(any)`

Produces an object from the given input value. If the input is iterable, `toObject` assumes that each entry is a two-element array of key and value.

```javascript
const { toObject } = require('@sullux/fp-light-to-object')

toObject() // { 'Undefined': undefined }

toObject(null) // { 'Null': null }

toObject([['foo', 'bar'], ['baz', 42]]) // { foo: 'bar', baz: 42 }

toObject({ foo: 42 }) // { foo: 42 }

toObject(new Date()) // { Date: 2019-03-01T14:56:53.812Z }

toObject(42) // { Number: 42 }

toObject('foo') // { String: 'foo' }

toObject(() => 42) // { Function: [Function] }
```
npm package: @sullux/fp-light-trap
Description: A lightweight functional library for functional composition and object composition.
Author: Charles Sullivan
Latest version: 0.0.1

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-trap

`npm i @sullux/fp-light-trap`
[source](https://github.com/Sullux/fp-light/blob/master/lib/trap/trap.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/trap/trap.spec.js)

The trap helper allows for a more functional approach to error handling.

* [trap](#trap)

### trap

`trap(critical: (...mixed[]) => [] | Promise): (...mixed[]) => [] | Promise<[]>`

The trap function can accept two types of values: a function or a thennable. When passed a function, trap returns a wrapped function that will return or resolve to a callback-style array in the form of `[error, result]`. When passed a thennable, trap will return a promise that resolves to the callback-style `[error, result]` array.

Following is an example that uses error trapping. This example exports a function that is made to be used in a directory of json files. The `readAllObjects` function reads all files in the given directory, parses them, and returns a promise that resolves to the array of all the objects read from the files.

The reason error trapping is so important in this example is that file systems are inconsistent. Instead of checking for the existence or type of a file, recommended practice is to try to read the file and ignore errors. Note that this example will still resolve to an error if the file data cannot be parsed as JSON.

```javascript
const { get } = require('@sullux/fp-light-get')
const { pipe } = require('@sullux/fp-light-pipe')
const { trap } = require('@sullux/fp-light-trap')
const { readFile, readdir } = require('fs')
const { promisify } = require('util')

const readAllObjects = pipe(
  promisify(readdir),
  map(get('toString')),
  map(trap(promisify(readFile))),
  filter(get(1)),
  map(get(1, 'toString')),
  map(JSON.parse),
  Promise.all,
)

module.exports = { readAllObjects }
```
npm package: @sully_al/player-icon
Description: The `player-icon` is a custom HTML element built using Svelte. It provides a flexible and customizable way to display various player-related icons with support for stroke and solid styles.
Author: Sully
Latest version: 0.0.6


# `player-icon` Custom Element

The `player-icon` is a custom HTML element built using Svelte. It provides a flexible and customizable way to display various player-related icons with support for stroke and solid styles.

## Installation


```bash
npm i @sully_al/player-icon
```

## Usage

You can use the `player-icon` custom element in your HTML as follows:

```html
<player-icon
    icon="mute"
    class="hidden h-10 md:h-14 w-10 md:w-14 duration-500 opacity-0 transition-all animate-out zoom-out fade-out
           group-data-[muted]:block group-data-[muted]:fade-in group-data-[muted]:animate-in group-data-[muted]:opacity-100
           group-data-[muted]:duration-500 group-data-[muted]:zoom-in">
</player-icon>
```

### Attributes

- **`icon`**: Specifies the icon to display. Acceptable values include:
    - `play`
    - `pause`
    - `forward`
    - `rewind`
    - `mute`
    - `low`
    - `high`
    - `cc`
    - `settings`
    - `pipOn`
    - `pipOff`
    - `expand`
    - `shrink`
    - `cast`
    - `airplay`


- **`type`** *(optional)*: Specifies the icon style. Acceptable values are:
    - `stroke` (default)
    - `solid`

### Example with Solid Icons

```html
<player-icon
    icon="play"
    type="solid"
    class="h-12 w-12 text-blue-500">
</player-icon>
```

## License

This project is licensed under the MIT License.
```
npm package: @sulman/novarel
Description: A progressive framework for building web applications in Node.js.
Author: Muhammad Sulman
Latest version: 0.1.0

# Novarel

A progressive **convention-over-configuration** framework for building web applications in Node.js.

> [!WARNING]
> **Novarel is currently under active development.**

---

## Overview

Novarel focuses on developer productivity by prioritizing sensible defaults and a modular architecture. It provides a structured foundation for building scalable applications without the boilerplate, allowing you to focus on writing your core logic.

## The Service Container

The Service Container is the central piece of Novarel, managing class dependencies and enabling seamless dependency injection throughout your application.

### Basic Usage

The container simplifies the management of objects by allowing you to bind abstractions to concrete implementations.

#### Binding a Class

```javascript
import { Container } from 'novarel';

const container = new Container();

// Bind a class
container.bind('UserService', { useClass: UserService });

// Resolve it later
const userService = container.make('UserService');
```

#### Singletons

Singletons ensure that a class is instantiated only once and the same instance is returned on subsequent calls.

```javascript
container.singleton('Database', { useValue: new DatabaseConnection() });
```

#### Dependency Injection

Novarel automates dependency injection using `$injections` or `$inject`.

```javascript
class UserController {
    static $injections = ['UserService'];

    constructor(userService) {
        this.userService = userService;
    }
}

container.bind('UserController', { useClass: UserController });
const controller = container.make('UserController');
```

### Features

- **Lazy Resolution**: Instantiate dependencies only when they are first used with `makeLazy()`.
- **Tagging**: Group multiple services under a single tag and resolve them collectively using `tagged()`.
- **Aliases**: Define multiple names for a single binding to improve code readability.

---

## License

Novarel is open-sourced software licensed under the [MIT license](LICENSE).