open-index/open-npm huggingface dataset:
npm package: @rapidimages/storage-api-client
Description: storage api client
Author: James Kyburz
Latest version: 1.3.9

# Storage api client

# [Content-addressable storage](https://en.wikipedia.org/wiki/Content-addressable_storage) api for files.

[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/feross/standard)
[![build status](https://api.travis-ci.com/rapidimages/storage-api.svg)](https://travis-ci.com/rapidimages/storage-api)
[![npm](https://img.shields.io/npm/v/@rapidimages/storage-api-client.svg)](https://npmjs.org/package/@rapidimages/storage-api-client)
[![downloads](https://img.shields.io/npm/dm/@rapidimages/storage-api-client.svg)](https://npmjs.org/package/@rapidimages/storage-api-client)

```js
const Client = require('@rapidimages/storage-api-client')
```

## `Client(url)`

`url` base url to storage api

Returns an instance of client.

# methods

## client.upload(files, [options])

`files` as an array of either file streams in node, or a file list from a input type file / drag drop.

`options.onUploadProgress({ percentage, total, loaded, totalMB, uploadedMB, file })`

`options.onHashProgress({ file, total, loaded, percentage})`

`options.onRequest(request)`

`options.onUnknown(unknown)` contains object of files that will be uploaded to api

## Usage

```js
const manifestKey = await Client('url').upload([files])
// a hash to the manifest of this upload containing all file keys
```

All files are hashed using `sha1` both in the browser and node.

Each upload will create a manifest in the following format

```js
{
  "files": [
    {
      "size": 697,
      "name": "filepath",
      "key": "0d5061684f1d3c8262bfdefe5c373131a6358aba"
    }
  ]
}
```

All files including the manifest are served using http `/get/key`

# Upload

Files that are known by the server will not be uploaded again :) this is thanks to sha1 hashing.

# license

[Apache License, Version 2.0](LICENSE)
npm package: @rapidimages/storage-api-router
Description: storage api router
Author: James Kyburz
Latest version: 1.3.9

# Storage api [![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/feross/standard) [![build status](https://api.travis-ci.com/rapidimages/storage-api.svg)](https://travis-ci.com/rapidimages/storage-api) [![npm](https://img.shields.io/npm/v/@rapidimages/storage-api-server.svg)](https://npmjs.org/package/@rapidimages/storage-api-server) [![downloads](https://img.shields.io/npm/dm/@rapidimages/storage-api-server.svg)](https://npmjs.org/package/@rapidimages/storage-api-server) [![Docker Pulls](https://img.shields.io/docker/pulls/rapidimages/storage-api.svg)]()

# [Content-addressable storage](https://en.wikipedia.org/wiki/Content-addressable_storage) api for files.

## [Client](packages/storage-api-client) and [Server](packages/storage-api-server) for file storage.

# Client

```js
const Client = require('@rapidimages/storage-api-client')
```

## `Client(url)`

`url` base url to storage api

Returns an instance of client.

# methods

## client.upload(files, [options])

`files` in array of either file streams in node, or a file list from a input type file / drag drop.

`options.onUploadProgress({ percentage, total, loaded, totalMB, uploadedMB, file })`

`options.onHashProgress({ file, total, loaded, percentage})`

`options.onRequest(request)`

`options.onUnknown(unknown)` contains object of files that will be uploaded to api

## Usage

```js
const manifestKey = await Client('url').upload([files])
// a hash to the manifest of this upload containing all file keys
```

All files are hashed using `sha1` both in the browser and node.

Each upload will create a manifest in the following format

```js
{
  "files": [
    {
      "size": 697,
      "name": "filepath",
      "key": "0d5061684f1d3c8262bfdefe5c373131a6358aba"
    }
  ]
}
```

All files including the manifest are served using http `/get/key`

# Browser / Node

The client is available for both node and the browser.

# Upload

Files that are known by the server will not be uploaded again :) this is thanks to sha1 hashing.

# Usage

```sh
STORAGE_PATH=x LOG_PRETTY=1 PORT=5000 npm start
```

# http get /get/key.type

.type is optional will either return content or 404 if not found.

# http post /get/unknown

`body contains an array of hashes`

Will return an array of unknown hashes.

# http post multipart /get/upload

Will return a string which will be the sha1 hash of the manifest.

# Running Server in docker

```sh
ᐅ docker pull rapidimages/storage-api:version
ᐅ docker run --rm --name storage-api -p 5000:5000 rapidimages/storage-api:version
```

This is the recommended way of running the server behind a reverse proxy like [traefik](https://traefik.io/).

# license

[Apache License, Version 2.0](LICENSE)
npm package: @rapidimages/storage-api-server
Description: storage api server
Author: James Kyburz
Latest version: 1.3.9

# Storage api [![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/feross/standard) [![build status](https://api.travis-ci.com/rapidimages/storage-api.svg)](https://travis-ci.com/rapidimages/storage-api) [![npm](https://img.shields.io/npm/v/@rapidimages/storage-api-server.svg)](https://npmjs.org/package/@rapidimages/storage-api-server) [![downloads](https://img.shields.io/npm/dm/@rapidimages/storage-api-server.svg)](https://npmjs.org/package/@rapidimages/storage-api-server) [![Docker Pulls](https://img.shields.io/docker/pulls/rapidimages/storage-api.svg)]()

# [Content-addressable storage](https://en.wikipedia.org/wiki/Content-addressable_storage) api for files.

## [Client](packages/storage-api-client) and [Server](packages/storage-api-server) for file storage.

# Client

```js
const Client = require('@rapidimages/storage-api-client')
```

## `Client(url)`

`url` base url to storage api

Returns an instance of client.

# methods

## client.upload(files, [options])

`files` in array of either file streams in node, or a file list from a input type file / drag drop.

`options.onUploadProgress({ percentage, total, loaded, totalMB, uploadedMB, file })`

`options.onHashProgress({ file, total, loaded, percentage})`

`options.onRequest(request)`

`options.onUnknown(unknown)` contains object of files that will be uploaded to api

## Usage

```js
const manifestKey = await Client('url').upload([files])
// a hash to the manifest of this upload containing all file keys
```

All files are hashed using `sha1` both in the browser and node.

Each upload will create a manifest in the following format

```js
{
  "files": [
    {
      "size": 697,
      "name": "filepath",
      "key": "0d5061684f1d3c8262bfdefe5c373131a6358aba"
    }
  ]
}
```

All files including the manifest are served using http `/get/key`

# Browser / Node

The client is available for both node and the browser.

# Upload

Files that are known by the server will not be uploaded again :) this is thanks to sha1 hashing.

# Usage

```sh
STORAGE_PATH=x LOG_PRETTY=1 PORT=5000 npm start
```

# http get /get/key.type

.type is optional will either return content or 404 if not found.

# http post /get/unknown

`body contains an array of hashes`

Will return an array of unknown hashes.

# http post multipart /get/upload

Will return a string which will be the sha1 hash of the manifest.

# Running Server in docker

```sh
ᐅ docker pull rapidimages/storage-api:version
ᐅ docker run --rm --name storage-api -p 5000:5000 rapidimages/storage-api:version
```

This is the recommended way of running the server behind a reverse proxy like [traefik](https://traefik.io/).

# license

[Apache License, Version 2.0](LICENSE)
npm package: @rapidjs.org/create-rjs
Description: Create an rJS application from a template.
Author: Thassilo Martin Schiepanski
Latest version: 0.1.0

## @rapidjs.org/create-rjs

Create an rJS application from a template.

### Usage

``` console
npm create @rapidjs.org/rjs@latest <TEMPLATE>
```

| `TEMPLATE` | Description |
| :- | :- |
| `min` | A minimal web application structure to quickstart any rJS project. |
| `plugin` | A basic plugin structure to develop an isolated, reusable rJS plugin. |

> Browse more templates at https://rapidjs.org/templates.
npm package: @rapidjs.org/releasing
Description: Java- and TypeScript package release helper utility.
Author: Thassilo Martin Schiepanski
Latest version: 0.3.1

# rJS Releasing

Java- and TypeScript package release helper utility (NPM). Works with single package repos, as well as with multi-package monorepos.

``` cli
npm install -D @rapidjs.org/releasing
```

## Prerequisites

- [NPM](https://www.npmjs.com)
- Registry CLI (if not NPM)

## Usage

Execute the release command int the repository root (also in monorepos).

``` console
(npx) rjs-releasing <package-path>?
```

> If no package directory path is specified, the current working directory is used.

> The version bump is balanced, i.e. all packages in a monorepo are updated to the maximum next version according to the release type. E.g., a minor of `0.5.13` and `1.0.1` would result in all `1.1.0`.

| Flag | Description |
| :- | :- |
| `--github` | Open a GitHub release creation for a package tag. |
| `--stacktrace` | Always print the full stack trace of errors. |
| `--dry-run` | Perform a publish cycle without an actual push to the registry (NPM only). |

| Option | Description |
| :- | :- |
| `--client` | Specify registry client to use (default 'npm', or 'yarn'). |

> Run `npx rjs-releasing help` to display information about the CLI.

### Monorepo package filter

In order to whitelist paclages to consider for a balanced release, provide a `release.deps.json`. All packages (paths) stated in an array are filtered for the release. Any other package in the monorepo setup is then ignored.

``` json
[
  "./packages/b",
  "./packages/a"
]
```

##

<sub>© Thassilo Martin Schiepanski</sub>
npm package: @rapidjs.org/rjs
Description: rJS (pron. ‘rapidJS’) is a plugin-based build interface, and a progressive web server based on virtual build capabilities.
Author: Thassilo Martin Schiepanski
Latest version: 0.4.1

<p align="center">
  <a href="https://rapidjs.org" target="_blank">
    <img src="https://rapidjs.org/assets/img/repo-preview.png" alt="https://rapidjs.org" width="830">
  </a>
  <h1 align="center">rJS</h1>
</p>

<p align="center">
  <a href="https://github.com/rapidjs-org/rJS/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/rapidjs-org/rjs/test.yml?label=test&logo=github"></a>
  <a href="https://github.com/rapidjs-org/rJS/blob/main/LICENSE"><img src="https://img.shields.io/github/license/rapidjs-org/rjs"></a>
  <a href="https://www.npmjs.com/package/@rapidjs.org/rjs"><img src="https://img.shields.io/npm/v/@rapidjs.org/rjs?logo=npm"></a>
  <a href="https://www.npmjs.com/package/@rapidjs.org/rjs"><img src="https://img.shields.io/bundlephobia/minzip/@rapidjs.org/rjs?label=size&logo=npm"></a>
</p>

<p align="center">
  <strong><a href="https://rapidjs.org" target="_blank">rJS</a> (pron. ‘rapidJS’)</strong> is a plugin-based build interface, and
  <br>
  a progressive web server based on virtual build capabilities.
</p>

## Install

``` console
npm i -g @rapidjs.org/rjs
```

## Use

At the core, rJS (pron. ‘rapidJS’) is an intuitive filesystem-derived build interface. Additionaly, it can be used with a production-ready web application server to move and hide the build step behind the server interface. rJS has been designed and developed with a delightful developer experience in mind.

``` console
(npx) rjs serve --dev --source-dir ./source
```

## Learn

- 🚀 [Get Started](https://rapidjs.org/docs?p=introduction:index)
- 📕 [Read the Docs](https://rapidjs.org/docs)
- 📓 [Try the Tutorial](https://rapidjs.org/docs?p=tutorial:index)

##

<sub>&copy; rJS (rapidJS) • Thassilo Martin Schiepanski</sub>
npm package: @rapidjs.org/testing-cli
Description: rJS Testing – CLI testing suite.
Author: Thassilo Martin Schiepanski
Latest version: 0.1.1

# [rJS Testing](https://github.com/rapidjs-org/testing) CLITest `cli`

rJS Testing CLI testing suite (`CLITest`): Test command line interfaces based on expected stdout or stderr.

``` cli
npm i -D @rapidjs.org/testing-cli
```

``` cli
npx rjs-testing cli <tests-path>
```

> Integrated in [`rapidjs-org/testing`](https://github.com/rapidjs-org/testing).

## Configuration

In order to define common CLI aspects, they can be defined through the static `.configure()` method:

``` ts
HTTPTest.configure(configuration: RequestOptions & {
  commonBinary?: string;
});
```

## Test Anatomy

### Expressions

#### Actual

``` ts
.actual(binary: string, arg?: string[])
.actual(args: string[]) // Imply binary if defined a common
```

#### Expected

``` ts
.expected(feedback: {
  stdout?: string|string[];         // Either text as is, or array of lines
  stderr?: string|string[];
})
.expected(stdout: string|string[])  // Only check stdout
```

> The execution output to be compared is whitespace normalised, i.e. any non-break whitespace character is condensed to a single space.

### Value-based Assertion

``` ts
new CLITest("Print working directory")
.actual("pwd")
.expected("/Users/rjs/app");
```

## Comparison Strategy

Before a comparison of a binary execution output, it is whitespace normalised. This is, any non-break whitespace character is condensed to a single space.

**✅ &thinsp; SUCCESS**

``` js
.actual("ls", [ "-L" ])
.expected("img1.png img2.png")
```
  
**❌ &thinsp; FAILURE**

``` js
.actual("ls", [ "-L" ])
.expected("img1.png    img2.png")
```

##

<sub>&copy; Thassilo Martin Schiepanski</sub>
npm package: @rapidjs.org/testing-http
Description: rJS Testing – HTTP testing suite.
Author: Thassilo Martin Schiepanski
Latest version: 0.1.2

# [rJS Testing](https://github.com/rapidjs-org/testing) HTTPTest `http`

rJS Testing HTTP(S) testing suite (`HTTPTest`): Test endpoints based on expectation filtered responses.

``` cli
npm i -D @rapidjs.org/testing-http
```

``` cli
npx rjs-testing http <tests-path>
```

> Integrated in [`rapidjs-org/testing`](https://github.com/rapidjs-org/testing).

## Configuration

In order to define common request options, they can be defined through the static `.configure()` method:

``` ts
HTTPTest.configure(configuration: RequestOptions & {
  pathRoot?: string;
});
```

## Test Anatomy

### Expressions

The expressions abstract an initial request (actual) and a successive response (expected). 

#### Actual

``` ts
.actual(url: string, requestOptions: RequestOptions)
// https://nodejs.org/api/http.html#httprequesturl-options-callback
```

#### Expected

``` ts
interface IResponse {  // Request information
  status: number;      // 200 (default)
  headers?: {
    [ name: string ]: string;
  };
  body?: any;
}

.expected(response: IResponse)
```

### Value-based Assertion

``` js
new HTTPTest("Get car models")
.actual("/models", {
  headers: {
    "Content-Type": "application/json"
  }
})
.expected({
  status: 200,
  body: [
    {
      manufacturer: "Audi",
      name: "Q5"
    },
    {
      manufacturer: "Ford",
      name: "Bronco"
    },
    {
      manufacturer: "Toyota",
      name: "RAV4"
    }
  ]
});
```

``` ts
new HTTPTest("Create car model")
.actual("/models", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: {
    name: "Q3"
  }
})
.expected({
  status: 422,
  body: "Missing manufacturer name"
});
```

<sup>[View More Examples](../../examples/http)</sup>

## Comparison Strategy

The comparison strategy does only respected properties stated on the expected response object (down to atomic properties). This is, every leaf-most property on the actual value object – corresponding to the HTTP response – that is not on the expected object is discarded before soft deep equal comparison.
  
**✅ &thinsp; SUCCESS**

``` js
.actual("/models", {
  headers: {
    "Content-Type": "application/json"
  }
})
/* results in: {
 *   body: […]
 *   headers: {
 *     "Content-Type": "application/json",
 *     "Content-Length": 225,
 *     "Server": "rapidJS"
 *   },
 *   status: 200,
 *   […]
 * }
 */
.expected({
  status: 200,
  headers: {
    "Content-Length": 225
  }
})
```
  
**❌ &thinsp; FAILURE**

``` js
.actual("/models", {
  headers: {
    "Content-Type": "application/json"
  }
})
// results in: see above
.expected({
  status: 404,
  headers: {
    "Content-Length": 225
  }
})
```

##

<sub>&copy; Thassilo Martin Schiepanski</sub>
npm package: @rapidjs.org/testing-unit
Description: rJS Testing – Unit testing suite.
Author: Thassilo Martin Schiepanski
Latest version: 0.1.1

# [rJS Testing](https://github.com/rapidjs-org/testing) UnitTest `unit`

rJS Testing unit testing suite (`UnitTest`): Test arbitrary units of code based on deep expectation comparisons.


``` cli
npm i -D @rapidjs.org/testing-unit
```

``` cli
npx rjs-testing unit <tests-path>
```

> Integrated in [`rapidjs-org/testing`](https://github.com/rapidjs-org/testing).

## Test Anatomy

### Expressions

``` ts
.actual(expression: any)
.expected(expression: any)  // Identity assertion
```

### Value-based Assertion

``` js
new UnitTest("Computes quotient of positive integers")
.actual(4 / 2)
.expected(2);
```

### Error-based Assertion

``` ts
new UnitTest("Computes quotient of positive integers")
.actual(() => 4 / x)
.error("x is not defined", ReferenceError);
```

<sup>[View More Examples](../../examples/unit)</sup>

## Comparison Strategy

Unit tests work on arbitrary values. That being said, the comparison strategy implements soft (`==`) deep equality:
  
**✅ &thinsp; SUCCESS**

``` js
.actual({
  foo: {
    bar: 2
  }
})
.expected({
  foo: {
    bar: "2"
  }
})
```
  
**❌ &thinsp; FAILURE**

``` js
.actual({
  foo: {
    bar: 2
  }
})
.expected({
  foo: {
	bar: 4
  }
})
```

``` js
.actual({
  foo: {
    bar: 2
  }
})
.expected({
  foo: {
	bar: 2
  },
  baz: 4
})
```

##

<sub>&copy; Thassilo Martin Schiepanski</sub>