open-index/open-npm huggingface dataset:
npm package: @haeley/auxiliaries
Description: Auxiliary TypeScript library for the haeley real-time rendering framework.
Author: Daniel Limberger
Latest version: 0.3.4

# haeley-auxiliaries

```
npm i -D @haeley/auxiliaries
```

*@haeley/auxiliaries* is a collection of auxiliaries functions such as logging, conditional logging, performance logging, assertions, fetching data as well as validation of and change detection in objects (using [`jsonschema`](https://github.com/tdegrunt/jsonschema)).
This library can be used as a standalone dependency, but is developed and intended for [`haeley`](https://github.com/halb3/haeley) real-time rendering framework.

[![npm Version](https://img.shields.io/npm/v/@haeley/auxiliaries.svg)](https://www.npmjs.com/package/@haeley/auxiliaries)
[![GitHub Action](https://img.shields.io/github/workflow/status/halb3/auxiliaries/test.svg)](https://github.com/halb3/auxiliaries/actions)
[![Coveralls](https://img.shields.io/coveralls/github/halb3/auxiliaries.svg?logo=coveralls)](https://coveralls.io/github/halb3/auxiliaries/)
[![CodeFactor](https://img.shields.io/codefactor/grade/github/halb3/auxiliaries/main.svg?logo=codefactor)](https://www.codefactor.io/repository/github/halb3/auxiliaries/)
![License](https://img.shields.io/github/license/halb3/auxiliaries.svg?logo=coveralls)
npm package: @haemomedtec/node-signalr
Description: A signalR client for Node.JS
Author: Oliver Nybo
Latest version: 3.2.0

# node-signalr

A signalR client for node.js which support ASP.net but not ASP.net Core. For ASP.net Core signalR support use the offical client from Microsoft.

This is a fork of @exhumer's fork of [node-signalr](https://www.npmjs.com/package/@exhumer/node-signalr). Our fork is to add some nice-to-have features.

## Install

```bash
$ npm i @haemomedtec/node-signalr
```

## Usage

### Create a SignalR Client Instance

```ts
import signalr from '@haemomedtec/node-signalr'

const client = new signalr.Client('http://localhost:8080/signalr', ['testHub'])
```

### Configuring Client

```js
// custom headers
client.headers['Token'] = 'Tds2dsJk'

// set timeout for sending message
client.callTimeout = 10000 // 10's, default 5000

// set delay time for reconecting
client.reconnectDelayTime = 2000 // 2's, default 5000

// set timeout for connect
client.requestTimeout = 2000 // 2's, default 5000
```

### Binding Client Events

```ts
client.on('connected', () => {
  console.log('SignalR client connected.')
})
client.on('reconnecting', (retryCount) => {
  console.log(`SignalR client reconnecting(${retryCount}).`)
})
client.on('disconnected', (reason) => {
  console.log(`SignalR client disconnected(${reason}).`)
})
client.on('error', (error) => {
  console.log(`SignalR client connect error: ${error.code}.`)
})
```

### Binding Hub Method

- Bind callback for receive message

```js
client.connection.hub.on('testHub', 'getMessage', (message) => {
  console.log('receive:', message)
})
```

- Call the hub method and get return values asynchronously

```ts
const message = { user: '', message: '' }

client.connection.hub
  .call('testHub', 'send', message)
  .then((result) => {
    console.log('success:', result)
  })
  .catch((error) => {
    console.log('error:', error)
  })
```

- Invoke the hub method without return values

```ts
const message = { user: '', message: '' }

client.connection.hub.invoke('testHub', 'send', message)
```

### Start Client

```ts
client.start()
```

### End Client

```ts
client.end()
```

## Powered By

- [ws](https://github.com/websockets/ws)

## License

[MIT](./LICENSE)
npm package: @haensl/environments
Description: Simple JSON object of runtime environments.
Author: HP Dietz
Latest version: 1.0.2

# @haensl/environments

JS runtime environments. Simple JSON object.

[![NPM](https://nodei.co/npm/@haensl%2Fenvironments.png?downloads=true)](https://nodei.co/npm/@haensl%2Fenvironments/)

[![npm version](https://badge.fury.io/js/@haensl%2Fenvironments.svg)](http://badge.fury.io/js/@haensl%2Fenvironments)
[![CircleCI](https://circleci.com/gh/haensl/environments.svg?style=svg)](https://circleci.com/gh/haensl/environments)


## Installation

### Via `npm`

```bash
$ npm install -S @haensl/environments
```

### Via `yarn`

```bash
$ yarn add @haensl/environments
```

## Usage

1. [Install @haensl/environments](#installation)

2. Use environments in your projects:


    ESM, i.e. `import`

    ```javascript
    import environments from '@haensl/environments';

    // Spreading the import works, too.
    // import { production } from '@haensl/environments';

    // ...

    if (currentEnvironment === environments.production) {
      // do stuff on production only
    }
    ```

    CJS, i.e. `require`

    ```javascript
    const environments = require('@haensl/environments');

    // ...

    if (currentEnvironment === environments.production) {
      // do stuff on production only
    }
    ```

## Synopsis

The `environments` object is a simple JSON object that maps to strings:

```javascript
{
  "development": "development",
  "production": "production",
  "qa": "qa",
  "test": "test"
}
```



## [Changelog](CHANGELOG.md)
npm package: @haensl/eslint-config
Description: Default ESLint configuration of HP Dietz.
Author: HP Dietz
Latest version: 2.0.0

# @haensl/eslint-config [![CircleCI](https://circleci.com/gh/haensl/eslint-config.svg?style=svg)](https://circleci.com/gh/haensl/eslint-config)

[![NPM](https://nodei.co/npm/@haensl%2Feslint-config.png?downloads=true)](https://nodei.co/npm/@haensl%2Feslint-config/)

[![npm version](https://badge.fury.io/js/@haensl%2Feslint-config.svg)](http://badge.fury.io/js/@haensl%2Feslint-config)

My default eslint configuration.

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/google-cloud
Description: Useful things around Google Cloud
Author: HP Dietz
Latest version: 1.0.1

# @haensl/google-cloud

Useful utitlities for working in Google Cloud.

[![NPM](https://nodei.co/npm/@haensl%2Fgoogle-cloud.png?downloads=true)](https://nodei.co/npm/@haensl%2Fgoogle-cloud/)

[![npm version](https://badge.fury.io/js/@haensl%2Fgoogle-cloud.svg)](http://badge.fury.io/js/@haensl%2Fgoogle-cloud)

[![CircleCI](https://circleci.com/gh/haensl/google-cloud.svg?style=svg)](https://circleci.com/gh/haensl/google-cloud)

## Installation

```bash
# via npm
npm i --save @haensl/google-cloud
```

## Usage

### `getAuthorization`: `async (url) => string` <a name="api/getAuthorization"></a>

Get authorization to call a URL. This is useful to authorize requests between services within Google Cloud.

#### Parameters

`url`: `string|URL`

The URL you want to call.

#### Returns

The Authorization header for the request to the given URL.

#### Example: Authorizing a request

```javascript
const { getAuthorization } = require('@haensl/google-cloud');
const fetch = require('node-fetch');

const callOtherService = async () => {
    // ...
    const otherService = new URL('https://myservice-1234567890.region.run.app');
    const authorization = await getAuthorization(otherService);

    const requestOptions = {
      method: 'GET',
      headers: {
        'Authorization': authorization
      }
    };

    const response = await fetch(otherService, requestOptions);

    // ...
};
```

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/http
Description: Simple JSON object of common HTTP headers, status codes and methods.
Author: HP Dietz
Latest version: 1.1.1

# @haensl/http

Simple JSON support module bundling common HTTP headers, status codes and methods.

[![NPM](https://nodei.co/npm/@haensl%2Fhttp.png?downloads=true)](https://nodei.co/npm/@haensl%2Fhttp/)

[![npm version](https://badge.fury.io/js/@haensl%2Fhttp.svg)](http://badge.fury.io/js/@haensl%2Fhttp)
[![CircleCI](https://circleci.com/gh/haensl/http.svg?style=svg)](https://circleci.com/gh/haensl/http)


## Installation

### Via `npm`

```bash
$ npm install -S @haensl/http
```

### Via `yarn`

```bash
$ yarn add @haensl/http
```

## Usage

1. [Install @haensl/http](#installation)

2. Use http status codes, methods and headers in your projects:


    ESM, i.e. `import`

    ```javascript
    import { statusCodes} from '@haensl/http';

    // ...
    const response = await fetch(url);

    if (response.statusCode < statusCodes.badRequest) {
      // do stuff when response status code < 400
    }

    // ...
    ```

    CJS, i.e. `require`

    ```javascript
    const { headers, methods } = require('@haensl/http');

    // ...
    const requestOptions = {
      headers: {
        [headers.contentType]: 'application/json'
      },
      method: methods.post,
      body: JSON.stringify(data)
    };

    const response = await fetch(url, requestOptions);

    // ...
    ```

## Synopsis

The `http` object is a simple JSON object that maps status codes, headers and strings:

```javascript
{
  "statusCodes": {
    "ok": 200,
    "created": 201,
    "accepted": 202,
    // ...
  },
  "headers": {
    "accept": "Accept",
    "accessControl": {
      "allow": {
        "origin": "Access-Control-Allow-Origin",
        "methods": "Access-Control-Allow-Methods"
        // ...
      },
      // ...
    },
    "authorization": "Authorization",
    "contentType": "Content-Type",
    // ...
  },
  "methods": {
    "delete": "delete",
    "get": "get",
    // ...
  }
}
```

### [JSON](index.json)

**Attention:** This JSON object is not exhaustive(, yet)! If you need a status code, header or method added, please [create a feature request](https://github.com/haensl/http/issues/new?labels=feature%20request)

## [Changelog](CHANGELOG.md)
npm package: @haensl/json-parser
Description: Minimal JSON file parser.
Author: HP Dietz
Latest version: 1.2.7

# json-parser

[![NPM](https://nodei.co/npm/@haensl%2Fjson-parser.png?downloads=true)](https://nodei.co/npm/@haensl%2Fjson-parser/)

[![npm version](https://badge.fury.io/js/@haensl%2Fjson-parser.svg)](http://badge.fury.io/js/@haensl%2Fjson-parser)

[![CircleCI](https://circleci.com/gh/haensl/json-parser.svg?style=svg)](https://circleci.com/gh/haensl/json-parser)

Minimal asynchronous JSON file parser for node.js

## Installation

```bash
# via npm
npm i --save @haensl/json-parser

# or yarn
yarn add @haensl/json-parser
```

## Usage

```javascript
const parseJSON = require('@haensl/json-parser');

parseJson('path/to/my.json')
  .then((json) => {
    console.info(json);
  });
```

### [Changelog](CHANGELOG.md)

### [License](LICENSE)
npm package: @haensl/json-transform-stream
Description: A Node.js Transform stream to wrap JSON data.
Author: HP Dietz
Latest version: 1.0.5

# @haensl/json-transform-stream
A Node.js [Transform Stream](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_class_stream_transform) implementation that makes wrapping JSON data easy.

[![NPM](https://nodei.co/npm/@haensl%2Fjson-transform-stream.png?downloads=true)](https://nodei.co/npm/@haensl%2Fjson-transform-stream/)

[![npm version](https://badge.fury.io/js/@haensl%2Fjson-transform-stream.svg)](http://badge.fury.io/js/@haensl%2Fjson-transform-stream)

[![CircleCI](https://circleci.com/gh/haensl/json-transform-stream.svg?style=svg)](https://circleci.com/gh/haensl/json-transform-stream)

## Installation

```bash
# via npm
npm i --save @haensl/json-transform-stream

# or yarn
yarn add @haensl/json-transform-stream
```

## Usage

```javascript
const JSONTransform = require('@haensl/json-transform-stream');

const jsonStream = getJSONObjectStreamFromSomewhere()
  .pipe(JSONTransform());

```

### Example: Streaming MongoDB cursors in [Koa](https://koajs.com/).
```javascript
const JSONTransform = require('@haensl/json-transform-stream');

// ...

router.get('/some-resource', async (ctx) => {
  // query your mongodb
  const cursor = await mongo
    .db('some-database')
    .collection('some-colletion')
    .find({
      // query
    });
  // don't forget to set the content type _before_ the first chunk
  ctx.set('Content-Type', 'application/json');
  ctx.status = 200;
  ctx.body = cursor
    .transformStream({
      transform: JSON.stringify // have the mongodb cursor emit JSON stringified chunks
    })
    .pipe(JSONTransform()); // wrap the chunks in an array
});
```

### Example: Safely streaming an array of JSON.

Since [sending plain arrays to clients is exploitable](https://cheatsheetseries.owasp.org/cheatsheets/AJAX_Security_Cheat_Sheet.html#protect-against-json-hijacking-for-older-browsers), you might want to wrap your array in an object.

```javascript
const JSONTransform = require('@haensl/json-transform-stream');

// ...

someJSONStream
  .pipe(JSONTransform({
    pre: '{"data":[',
    post: ']}'
  }));

// Result:
// {
//   "data": [
//      // data emitted by someJSONStream
//   ]
// }
}
```

## Synopsis

```javascript
({
  post = ']',
  pre = '[',
  separator = ','
}) => TransformStream
```

### Parameters

#### `options.post` _[optional]_
**Default:** `']'`

`String`. Suffix to append to data emitted by this stream.

#### `options.pre` _[optional]_
**Default:** `'['`

`String`. Prefix to prepend to data emitted by this stream.

#### `options.separator` _[optional]_
**Default:** `','`

`String`. Separator to join data emitted by this stream with.

### Returns

[`TransformStream`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_class_stream_transform). A Node.js transform stream.

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/koa-error-middleware
Description: Koa error logging middleware using iso-log.
Author: HP Dietz
Latest version: 1.0.1

# koa-error-middleware

Koa error logging middleware using [iso-log](http://github.com/haensl/iso-log).

[![NPM](https://nodei.co/npm/@haensl%2Fkoa-error-middleware.png?downloads=true)](https://nodei.co/npm/@haensl%2Fkoa-error-middleware/)

[![npm version](https://badge.fury.io/js/@haensl%2Fkoa-error-middleware.svg)](http://badge.fury.io/js/@haensl%2Fkoa-error-middleware)
[![CircleCI](https://circleci.com/gh/haensl/koa-error-middlware.svg?style=svg)](https://circleci.com/gh/haensl/koa-error-middleware)

If downstream middlewares throw, the koa-error-middleware handles those errors gracefully. If the error thrown by a downstream middleware contains a `status` property (as is the case with Koa's [`ctx.throw`](https://github.com/koajs/koa/blob/master/docs/api/context.md#ctxthrowstatus-msg-properties)), then the context status code is updated to reflect this, else the context status code is defaulted to 500 (internal server error).

If downstream middlewares throw an error with `status` lower than 500 and the [error is exposed](https://github.com/koajs/koa/blob/master/docs/api/context.md#ctxthrowstatus-msg-properties), the error message is set as the response body.

If the context status code ends up equal to or greater than 500 (internal server error), the error middleware logs the request and error using [iso-log](https://github.com/haensl/iso-log). This requires the [`iso-log` to be initialized](https://github.com/haensl/iso-log#config). When doing so the error middlware tries to extrapolate the user id from context, i.e. `ctx.userId`, and attaches the Koa context to the error.

## Installation

### Via `npm`

```bash
$ npm install -S @haensl/koa-error-middleware @haensl/iso-log
```

### Via `yarn`

```bash
$ yarn add @haensl/koa-error-middleware @haensl/iso-log
```

## Usage

1. [Install @haensl/koa-error-middleware](#installation)

2. Ensure you have [iso-log](https://www.npmjs.com/package/@haensl/iso-log) installed and initialized.

3. Use koa-error-middlware in your projects:


    ```javascript
    const Koa = require('koa');
    const errorLog = require('@haensl/koa-error-middleware');
    const log = require('@haensl/iso-log');

    // Initialize your app
    const app = new Koa();

    // Don't forget to initialize iso-log
    log.init({
      // ...
    });

    // Attach error logging middleware
    app.use(errorLog());
    ```

## Synopsis

The koa-error-middleware is exposed as a function that returns an `async` Koa middleware:

```javascript
() => async (ctx, next) => { }
```

## [Changelog](CHANGELOG.md)
npm package: @haensl/mimetypes
Description: Simple JSON object holding mimetypes.
Author: HP Dietz
Latest version: 1.1.0

# @haensl/mimetypes

Simple JSON object holding MIME types.

[![NPM](https://nodei.co/npm/@haensl%2Fmimetypes.png?downloads=true)](https://nodei.co/npm/@haensl%2Fmimetypes/)

[![npm version](https://badge.fury.io/js/@haensl%2Fmimetypes.svg)](http://badge.fury.io/js/@haensl%2Fmimetypes)
[![CircleCI](https://circleci.com/gh/haensl/mimetypes.svg?style=svg)](https://circleci.com/gh/haensl/mimetypes)

## Motivation

This is a simple JSON object collecting [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). The rationale for having them in a module is manifold including but not limited to consitency, accuracy, reuse, extensibility, future-proofing and collaboration.

At it's most basic level, this module tries to eliminate magic strings. Magic strings are magical in a bad way, they cast no spells, just confusion and potential bugs.

This MIME types collection is (very) far from complete - in fact it only contains the most commonly used mimetypes at the moment. However, the goal is to collect more as they become relevant to Node developers.

[Please feel free to request addition if you need a MIME type not included in this module](https://github.com/haensl/mimetypes/issues/new/choose?labels=feature%20request).

## Installation

### Via `npm`

```bash
$ npm install -S @haensl/mimetypes
```

### Via `yarn`

```bash
$ yarn add @haensl/mimetypes
```

## Usage

1. [Install @haensl/mimetypes](#installation)

2. Use mime types in your projects:


    ESM, i.e. `import`

    ```javascript
    import { json } from '@haensl/mimetypes';

    // ...

    const route = async (ctx) => {
      // some data from somewhere
      const data = await getData();

      // Use the json mimetype
      ctx.set(headers.contentType, json);

      ctx.body = JSON.stringify(data);
    }

    ```

    CJS, i.e. `require`

    ```javascript
    const { json } = require('@haensl/mimetypes');

    // ...

    const route = async (ctx) => {
      // some data from somewhere
      const data = await getData();

      // Use the json mimetype
      ctx.set(headers.contentType, json);

      ctx.body = JSON.stringify(data);
    }
    ```

## Synopsis

The `mimetypes` object is a simple JSON object that maps to strings:

```json
{
  "css": "text/css",
  "html": "text/html",
  "ico": "image/x-icon",
  "js": "text/javascript",
  "jpg": "image/jpeg",
  "json": "application/json",
  "jsonLd": "application/ld+json",
  "gif": "image/gif",
  "mp4": "video/mp4",
  "png": "image/png",
  "svg": "image/svg+xml",
  "text": "text/plain",
  "webm": "video/webm",
  "webp": "image/webp",
  "xml": "application/xml"
}
```

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/next-google-analytics
Description: Simple component to load gtag.js (Google Analytics 4) into a Next.js app. Works well with @haensl/google-analytics.
Author: HP Dietz
Latest version: 1.0.5

# @haensl/next-google-analytics

Simple component to load Google Analytics 4 `gtag.js` into a Next.js app. Works well with [`@haensl/google-analytics`](https://www.npmjs.com/package/@haensl/google-analytics).

[![NPM](https://nodei.co/npm/@haensl%2Fnext-google-analytics.png?downloads=true)](https://nodei.co/npm/@haensl%2Fnext-google-analytics/)

[![npm version](https://badge.fury.io/js/@haensl%2Fnext-google-analytics.svg)](http://badge.fury.io/js/@haensl%2Fnext-google-analytics)

[![CircleCI](https://circleci.com/gh/haensl/next-google-analytics.svg?style=svg)](https://circleci.com/gh/haensl/next-google-analytics)

## Installation

### Via `npm`

```bash
$ npm install -S @haensl/next-google-analytics
```

### Via `yarn`

```bash
$ yarn add @haensl/next-google-analytics
```

## Usage

In your root layout/page:

```javascript
import GoogleAnalytics from '@haensl/next-google-analytics';

export default function MyApp({ Component, props }) {
  return (
    <>
      <GoogleAnalytics measurementId={ process.env.GOOGLE_MEASUREMENT_ID } />

      <Component {...props} />
    </>
  )
};
```

## Synopsis

`@haensl/next-google-analytics` uses [`next/script`](https://nextjs.org/docs/pages/api-reference/components/script) under the hood to inject a `<script>` tag that loads [gtag.js](https://support.google.com/analytics/answer/9304153#zippy=%2Cadd-the-google-tag-directly-to-your-web-pages).

```javascript
  <GoogleAnalytics
    // Your Google measurement id. String.
    // The component will not render anything with a measurement id.
    // default: undefined
    measurementId="G-123ABC456B"

    // On-load callback. Function.
    // Called once gtag.js is loaded.
    // default: undefined
    onLoad={ onLoadCallback }

    // Customize the URL to gtag.js. String.
    // default: 'https://www.googletagmanager.com/gtag/js'
    src="https://www.googletagmanager.com/gtag/js"

    // next/script injection strategy.
    // default: 'afterInteractive'
    strategy="afterInteractive"
  />
```

See also [`@haensl/google-analytics`](https://www.npmjs.com/package/@haensl/google-analytics) to track analytics events throughout your Next.js application.

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/object
Description: Help for JavaScript objects.
Author: HP Dietz
Latest version: 1.0.0

# @haensl/object

Help for JavaScript objects.

[![NPM](https://nodei.co/npm/@haensl%2Fobject.png?downloads=true)](https://nodei.co/npm/@haensl%2Fobject/)

[![npm version](https://badge.fury.io/js/@haensl%2Fobject.svg)](http://badge.fury.io/js/@haensl%2Fobject)
[![CircleCI](https://circleci.com/gh/haensl/object.svg?style=svg)](https://circleci.com/gh/haensl/object)

## Install

### NPM
`npm i -S @haensl/object`

### Yarn
`yarn add @haensl/object`

## Use

```javascript
const { hasDefinedKeys } = require('@haensl/object');

const someProcessingFunction = async (input) =>
  const processed = await input.pipe(here)
    .map(there)
    .reduce(theData);

  if (hasDefinedKeys(processed)) {
    return processed;
  }

  // return null instead of empty objects
  return null;
}
```

## Synopsis

### removeUndefinedKeys: (obj) => obj <a name="removeUndefinedKeys"></a>

Returns a new object without `undefined` keys.

Example:

```javascript
const { removeUndefinedKeys } = require('@haensl/object');

const input = {
  foo: undefined,
  bar: 'foo',
  foobar: undefined
};

const out = removeUndefinedKeys(input);

// out == { bar: 'foo' }
```

### hasDefinedKeys: (obj) => boolean <a name="hasDefinedKeys"></a>

Checks whether an object has defined keys.

Example:

```javascript
const { hasDefinedKeys } = require('@haensl/object');

const empty = {
  foo: undefined
};

Object.keys(empty).length; // 1

hasDefinedKeys(empty); // false

hasDefinedKeys({ foo: 'bar' }); // true
```

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/pfs
Description: Lightweight, dependency-free, promise wrapper around fs.
Author: HP Dietz
Latest version: 2.4.2

# pfs

[![NPM](https://nodei.co/npm/@haensl%2Fpfs.png?downloads=true)](https://nodei.co/npm/@haensl%2pfs/)

[![npm version](https://badge.fury.io/js/@haensl%2Fpfs.svg)](http://badge.fury.io/js/@haensl%2Fpfs)

[![CircleCI](https://circleci.com/gh/haensl/pfs.svg?style=svg)](https://circleci.com/gh/haensl/pfs)

Lightweight, dependency-free, promise wrapper around node.js' [fs](https://nodejs.org/dist/latest-v9.x/docs/api/fs.html).

## Installation

```bash
$ yarn add @haensl/pfs

# or npm
$ npm install -S @haensl/pfs
```

## Use

Exactly how you would use `fs`. This is a drop-in replacement that converts any callback-based functions to promise-based ones.

```javascript
const fs = require('@haensl/pfs')

// now uses promise
fs.readFile('my-file.txt', 'utf-8')
  .then((content) => {
    // do nice things
  })
  .catch(...)

// still works the same
fs.readFileSync('my-file.txt', 'utf-8')

// properties are also unchanged
fs.constants.R_OK
```

## Credits

Based on [Chris Deacy's pfs](https://github.com/chrisdothtml/pfs).

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/react-json-schema
Description: Simple JSON+LD schema React component.
Author: HP Dietz
Latest version: 1.0.1

# @haensl/react-json-schema

Simple [JSON+LD schema](https://schema.org/) React component.

[![NPM](https://nodei.co/npm/@haensl%2Freact-json-schema.png?downloads=true)](https://nodei.co/npm/@haensl%2Freact-json-schema/)

[![npm version](https://badge.fury.io/js/@haensl%2Freact-json-schema.svg)](http://badge.fury.io/js/@haensl%2Freact-json-schema)

[![CircleCI](https://circleci.com/gh/haensl/react-json-schema.svg?style=svg)](https://circleci.com/gh/haensl/react-json-schema)

Render JSON+LD structured data aka microdata into `<script>` tags. Works as [recommended by Next.js](https://nextjs.org/docs/app/building-your-application/optimizing/metadata#json-ld).

## Installation

### Via `npm`

```bash
$ npm install -S @haensl/react-json-schema
```

### Via `yarn`

```bash
$ yarn add @haensl/react-json-schema
```

## Usage

This component is **not** pre-compiled, but exposed as ESModule.

```javascript
import JSONSchema from '@haensl/react-json-schema';

const MyComponent = (props) => {
  const organization = {
    '@context': 'https://schema.org/',
    '@type': 'Organization',
    '@id': 'https://acme.com',
    url: 'https://acme.com',
    name: 'ACME'
  };

  return (
    <div>
      <JSONSchema json={ organization } />

      // your markup...
    </div>
  )
};

export default MyComponent;
```

### Example: Usage with [`Next.js`](https://nextjs.org/docs/pages/api-reference/next-config-js/webpack) <a name="usage/next.js"></a>

```javascript
// Example next.config.js for adding a loader that will transpile @haensl/react-json-schema
module.exports = {
  webpack: (config, { defaultLoaders }) => {
    config.module.rules.push({
      test: /@haensl\/react-json-schema/,
      use: [
        defaultLoaders.babel,
      ]
    });

    return config;
  }
};
```


## Synopsis

`@haensl/react-json-schema`

The component will not render (i.e. return `null`) when it is not given JSON data.

Refer to [https://schema.org](https://schema.org) for information on structured data.


```javascript
  import JSONSchema from '@haensl/react-json-schema'

  <JSONSchema
    // A JSON schema object.
    // See https://schema.org
    json={{
      '@context': 'https://schema.org/',
      '@type': 'Organization',
      '@id': 'https://acme.com',
      url: 'https://acme.com',
      name: 'ACME'
    }}
  />
```

Renders to

```html
<script type="application/ld+json">{
  "@context":"https://schema.org/",
  "@type":"Organization",
  "@id":"https://acme.com",
  "url":"https://acme.com",
  "name":"ACME"
}</script>
```

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/rollup-plugin-local-resolve
Description: Rollup plugin to resolve relative imports from local folders without stating the index file
Author: HP Dietz
Latest version: 1.1.13

# rollup-plugin-local-resolve
[![NPM](https://nodei.co/npm/@haensl%2Frollup-plugin-local-resolve.png?downloads=true)](https://nodei.co/npm/@haensl%2Frollup-plugin-local-resolve/)

[![npm version](https://badge.fury.io/js/@haensl%2Frollup-plugin-local-resolve.svg)](http://badge.fury.io/js/@haensl%2Frollup-plugin-local-resolve)

[![CircleCI](https://circleci.com/gh/haensl/rollup-plugin-local-resolve.svg?style=svg)](https://circleci.com/gh/haensl/rollup-plugin-local-resolve)

Rollup plugin to resolve relative imports from local folders without stating the index file. E.g.

```javascript
import something from '../some-dir'.
```

## Quick start

1. Install the plugin

```bash
npm i -D @haensl/rollup-plugin-local-resolve
```

2. Use it in your `rollup.config.js`

```javascript
import localResolve from '@haensl/rollup-plugin-local-resolve';

export default {
  input: 'src/index.js',
  plugins: [
    localResolve()
  ],
  output: [
    {
      file: 'dist/index.cjs.js',
      format: 'cjs'
    },
    {
      file: 'dist/index.es.js',
      format: 'es'
    }
  ]
}
```

## Credits

* Functionality inspired by Johannes Stein's [rollup-plugin-local-resolve](https://github.com/frostney/rollup-plugin-local-resolve)
* Unit tests inspired by rollup's own [rollup-plugin-node-resolve](https://github.com/rollup/rollup-plugin-node-resolve)

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
npm package: @haensl/subset-sum
Description: Find a combination of integers to reach a given sum.
Author: HP Dietz
Latest version: 3.0.7

# Subset sum

[![NPM](https://nodei.co/npm/@haensl%2Fsubset-sum.png?downloads=true)](https://nodei.co/npm/@haensl%2Fsubset-sum/)

[![npm version](https://badge.fury.io/js/@haensl%2Fsubset-sum.svg)](http://badge.fury.io/js/@haensl%2Fsubset-sum)
[![CircleCI](https://circleci.com/gh/haensl/subset-sum.svg?style=svg)](https://circleci.com/gh/haensl/subset-sum)

Node.js module to compute solutions to the [Coin changing problem](http://rosettacode.org/wiki/Count_the_coins), i.e. find combinations of integers from a given set of available integers that sum up to a desired result.

## Quick start

1. Install the library

via `npm`

```bash
npm i -S @haensl/subset-sum
```

via `yarn`

```bash
yarn add @haensl/subset-sum
```

2. Use the library in your code

in CommonJS _(e.g. Node.js)_

```javascript
const sumService = require('@haensl/subset-sum');

const numbers = [1, 4, 2, 5, 1, 3];
const target = 6;
const solver = sumService.subsetSum(numbers, target);

for (let solution of solver) {
  console.log(solution);
}
```

in ESM _(e.g. Browser)_

```javascript
import sumService from '@haensl/subset-sum';

const numbers = [1, 4, 2, 5, 1, 3];
const target = 6;
const solver = sumService.subsetSum(numbers, target);

for (let solution of solver) {
  console.log(solution);
}
```

### [→ Codepen Example](https://codepen.io/haensl/pen/QWNdKGR)

## API

`subsetSum(numbers, target) => Generator`

Returns a generator that yields arrays of integers from `numbers` that add up to `target`.

`uniqueSolutions(solutions) => Array`

Filters `solutions` for unique solutions.

`isSameSolution(solutionA, solutionB) => boolean`

Compares to solutions and determines if they are equal, i.e. contain the same integers. E.g. `[1, 1, 3, 1]` and `[1, 3, 1, 1]` are considered equal.


## [Changelog](CHANGELOG.md)

## [Licence](LICENSE)
npm package: @haesh/server
Description: haesh-server ============
Author: Stefan Lew
Latest version: 0.0.2

haesh-server
============

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/@haesh/server.svg)](https://npmjs.org/package/@haesh/server)
[![Downloads/week](https://img.shields.io/npm/dw/@haesh/server.svg)](https://npmjs.org/package/@haesh/server)

* [Requirements](#requirements)
* [Quick Start](#quick-start)

# Requirements
- Node.js and npm must be installed on your system.

# Quick Start
```shell
# Install the command line tool
$ npm install -g @haesh/server
# Create a new hae.sh server
$ haesh-server init
```
npm package: @haessar/jbrowse-plugin-bedfeaturecoloring
Description: Use more display options when rendering BED files
Author: William Haese-Hill
Latest version: 1.0.4

# jbrowse-plugin-bedfeaturecoloring
Simple "no-build" ESM plugin for Jbrowse 2, which defines a jexl callback function `colorFeature` to harness the `score` and `itemRgb` columns in a BED file `FeatureTrack` for enhanced visualisation.

`itemRgb` is a string containing a comma-separated list of three integer values representing red, green and blue, each in the range 0-255. e.g. `"255,0,0"` for red.

`score` is an integer value between 0-1000, which is scaled to a float in the range 0-1 for the alpha component of the color.

Each feature line in the BED file will have its color rendered using these two values.

## Quick start
1. Create a local jbrowse-web instance
```
npx @jbrowse/cli create jbrowse-web
cd jbrowse-web
```

2. Launch local instance 
```
npx serve . -p 3000
```

3. Navigate to `http://localhost:3000/?config=https://unpkg.com/@haessar/jbrowse-plugin-bedfeaturecoloring@latest/test_config.json` in browser to use a test `config.json` from the latest version of the plugin.

## Defining custom tracks
The following template `config.json` shows how to define a custom BED `FeatureTrack` to utilise the `colorFeature` function in its display:
```
{
  "plugins": [
    {
      "name": "BedFeatureColoring",
      "url": "https://unpkg.com/@haessar/jbrowse-plugin-bedfeaturecoloring"
    }
  ],
  "assemblies": [...],
  "tracks": [
    {
      "type": "FeatureTrack",
      "name": "Colored BED Track",
      "adapter": {
        "type": "BedAdapter",
        "bedLocation": { "uri": "path/to/file.bed" }
      },
      "displays": [
        {
          "type": "LinearBasicDisplay",
          "renderer": {
            "type": "SvgFeatureRenderer",
            "color1": "jexl:colorFeature(feature)"
          }
        }
      ]
    }
  ]
}
```

## Contributors

- [@haessar](https://github.com/haessar)
- [@tobyweir](https://github.com/tobyweir)
npm package: @haetae.finance/blockchain-addressbook
Description: A collection of useful addresses on various chains for defi development
Latest version: 0.54.166

# address-book

A collection of useful addresses on EVM chains for defi development

### Contributing


1. Read the [CONTRIBUTING](./CONTRIBUTING.md) doc first
1. run `npm ci`. This will install the packages and prepare husky pre-commit hook 
1. Add addresses:
   1. If new platform: 
       1. Add a file for the platform (i.e pancakeswap) under the respective chain in address-book/<your chain name>
       1. Add the third party contracts in an object there and export the object. 
       1. Add the export to the chain's index.ts file.
   1. For tokens:
      1. Add to respective token.ts file, with token symbol as key. Make sure the decimals are correct for the token. Usually you can find this info via the chain's block explorer.   
1. Try to commit the change. If it fails, its because the address isn't passing the checksum check. Look at the console output and paste the correct address.
1. Once commit goes through, raise a PR
1. If the checksum passes, a maintainer will review it and merge it
1. Once merged, the package version will be bumped and the package will be published. Run `npm install <package>@latest` in the consuming repo to consume the new package version.
npm package: @haetae/javascript
Description: Utilities like automatic dependency graph resolver of Javascript ecosystem (e.g. including Typescript, JSX) for Haetae
Author: Gil B. Chan
Latest version: 0.0.19

# `@haetae/javascript`

Features related to Javascript ecosystem (e.g. dependency graph, Typescript, JSX) for Haetae.

Refer to the official documentation website.
npm package: @haethashaikh/text-coloring
Description: creates a colourful consol-log
Author: harethaalshikh@gmail.com
Latest version: 2.0.0

# Text-coloring
this awesomesauce package makes a colourful console log

## Usage
install with `npm i @noget/text-coloring`
``` javascript
var rainbowLog = require("@noget/text-coloring");
text-coloring("i am rainbow");
```
npm package: @hafizmbilal/smart-logger
Description: Production-ready Winston logger with daily rotation, safe JSON handling, and logger.log() alias
Author: Hafiz Bilal
Latest version: 1.0.0

# Smart Logger

A production-ready Winston logger with:

- Daily rotating logs
- Separate per-level logs
- Combined logs
- Safe JSON & circular object handling
- `logger.log()` alias (routes to `info`)
- Multi-argument support

## Install
```bash
npm install smart-logger

## Usage
const logger = require("@hafizmbilal/smart-logger");
logger.log("Hello world");
logger.info("Server started", { port: 3000 });
logger.warn("Slow request", { timeMs: 1200 });
logger.error("DB failed", new Error("Connection refused"));

## Log Structure
logs/
  combined/
  error/
  warn/
  info/
  debug/
npm package: @hafslundnett/hdd-icons
Description: Icons used across Hafslund Nett projects.
Author: Hafslund Nett
Latest version: 1.5.1

# @hafslundnett/hdd-icons
Hdd icons for web services and native apps.

## Installation

### TBD: Install via CDN (preferred)
Use the latest version:
```html
<!-- <script src="https://"></script> -->
```
Or choose a specific version:
```html
<!-- <script src="https://"></script> -->
```

### Install `npm` package
```bash
yarn install @hafslundnett/hdd-icons -dev
```

```js
import hddIcons from '@hafslundnett/hdd-icons'    // Vanilla JS
import {HddIcon} from '@hafslundnett/hdd-icons/hdd-icons.jsx' // ...or React/Preact compatible JSX
```

## Local development
First clone `@hafslundnett/hdd-icons` and install its dependencies:

```bash
git clone git@github.com:hafslundnett/hdd.git
cd hdd/packages/hdd-icons/
yarn install
yarn start # Your browser will open documentation with hot reloading
```

## Building and committing
After having applied changes, remember to build before pushing the changes upstream.

```bash
git checkout -b feature/my-changes
# update the source code
yarn build
git commit -am "feat: add my changes"
git push origin feature/my-changes
# then make a PR to the master branch,
# and assign another developer to review your code
```

> NOTE! Please also make sure to keep commits small and clean (that the commit message actually refers to the updated files).  
> Make sure the commit message is **Capitalized** and **starts with an imperative verb** (for example `feat: add minification support`). Preferrably follow the [commitizen](https://github.com/commitizen/cz-cli) standard.