open-index/open-npm huggingface dataset:
npm package: @jcoreio/abortable
Description: memory-leak-proof function to wrap a promise to reject when a signal is aborted
Author: Andy Edwards
Latest version: 1.0.4

# @jcoreio/abortable

memory-leak-proof function to wrap a promise to reject when a signal is aborted

[![CircleCI](https://circleci.com/gh/jcoreio/abortable.svg?style=svg)](https://circleci.com/gh/jcoreio/abortable)
[![Coverage Status](https://codecov.io/gh/jcoreio/abortable/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/abortable)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![npm version](https://badge.fury.io/js/%40jcoreio%2Fabortable.svg)](https://badge.fury.io/js/%40jcoreio%2Fabortable)

## `abortable(promise, signal)`

Creates a promise that fulfills when the given `promise` fulfills, or rejects when the given `signal` is aborted,
whichever comes first. If the signal is aborted, rejects with a `DOMException` with `name: 'AbortError'`.

Once the returned promise resolves or rejects, references to all promise and signal handlers will have been removed,
so that it doesn't unexpectedly retain any memory.

```ts
import { abortable } from '@jcoreio/abortable'

const abortController = new AbortContorller()
const { signal } = abortController

const promise = abortable(new Promise((r) => setTimeout(r, 10000)), signal)
```
npm package: @jcoreio/auth0-meteor
Description: Auth0 integration with Meteor Accounts
Author: Andy Edwards
Latest version: 3.4.1

# auth0-meteor

[![Build Status](https://travis-ci.org/jcoreio/auth0-meteor.svg?branch=master)](https://travis-ci.org/jcoreio/auth0-meteor)
[![Coverage Status](https://codecov.io/gh/jcoreio/auth0-meteor/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/auth0-meteor)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

Auth0 integration with Meteor Accounts

## Usage

```sh
meteor add accounts accounts-oauth
npm install --save auth0-js auth0-meteor
```

### Server
```js
import {Accounts} from 'meteor/accounts-base'
import 'auth0-meteor/lib/server'
import auth0LoginHandler from '@jcoreio/auth0-meteor/lib/server/auth0LoginHandler'
import wrapResumeHandler from '@jcoreio/auth0-meteor/lib/server/wrapResumeHandler'

const auth0Params = {
  clientId: process.env.AUTH0_MANAGEMENT_CLIENT_ID,
  clientSecret: process.env.AUTH0_MANAGEMENT_CLIENT_SECRET,
  domain: process.env.AUTH0_DOMAIN,
  audience: process.env.AUTH0_FRONTEND_CLIENT_ID,
}

Accounts.registerLoginHandler(auth0LoginHandler(auth0Params))
wrapResumeHandler(auth0Params)
```

#### `alanning:roles` v2.0 support
```js
import auth0LoginHandler from '@jcoreio/auth0-meteor/lib/server/auth0LoginHandler'
import rolesUpdater from '@jcoreio/auth0-meteor/lib/server/rolesUpdater'

Accounts.registerLoginHandler(auth0LoginHandler({
  ...
  updaters: [rolesUpdater({
    getRoles: (_id, profile) => profile.app_metadata && profile.app_metadata.roles, // default value
  })]
}))
```

#### Syncing to user.profile

The following will copy `auth0profile.user_metadata.theme` to `meteorUser.profile.theme` and
`auth0profile.app_metadata.location` to `meteorUser.profile.location`.

```js
import auth0LoginHandler from '@jcoreio/auth0-meteor/lib/server/auth0LoginHandler'
import profileUpdater from '@jcoreio/auth0-meteor/lib/server/profileUpdater'

Accounts.registerLoginHandler(auth0LoginHandler({
  ...
  updaters: [profileUpdater({
    fields: {
      theme: 'user_metadata.theme',
      location: 'app_metadata.location',
    },
  })]
}))
```

### Client
```js
import Auth from '@jcoreio/auth0-meteor/lib/client/Auth'

const auth = new Auth({
  clientID: process.env.AUTH0_CLIENT_ID,
  domain: process.env.AUTH0_DOMAIN,
  ...
})

// to begin login, run:
auth.authorize()

// to logout:
auth.logout()

// in your callback route, run:
auth.handleAuthentication()

// to subscribe to `services.auth0` data for the logged-in user:
import {Meteor} from 'meteor/meteor'
Meteor.subscribe('auth0.userData')

// to log in manually with username/password:
import loginWithAuth0 from '@jcorieo/auth0-meteor/lib/client/loginWithAuth0'
loginWithAuth0({username, password}).then(onResolved, onRejected)
```
npm package: @jcoreio/babel-plugin-transform-define
Description: Babel plugin that replaces member expressions and typeof statements with strings
Latest version: 1.2.1

<h1 align="center">babel-plugin-transform-define</h1>

<p align="center">
  <a title='Build Status' href="https://raw.githubusercontent.com/FormidableLabs/babel-plugin-transform-define/master/LICENSE">
    <img src='https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square' />
  </a>
  <a href="https://badge.fury.io/js/babel-plugin-transform-define">
    <img src="https://badge.fury.io/js/babel-plugin-transform-define.svg" alt="npm version" height="18">
  </a>
  <a href='http://travis-ci.org/FormidableLabs/babel-plugin-transform-define'>
    <img src='https://secure.travis-ci.org/FormidableLabs/babel-plugin-transform-define.svg?branch=master' />
  </a>
</p>

<h4 align="center">
  Compile time code replacement for babel similar to Webpack's <a href='https://github.com/webpack/docs/wiki/list-of-plugins#defineplugin'>DefinePlugin</a>
</h4>

***

## Quick Start

```shell
npm install babel-plugin-transform-define
```

**.babelrc**

```json
{
  "plugins": [
    ["transform-define", {
      "process.env.NODE_ENV": "production",
      "typeof window": "object"
    }]
  ]
}
```

**.babelrc**

```json
{
  "plugins": [
    ["transform-define", "./path/to/config/file.js"]
  ]
}
```
_Note_: Paths are relative to `process.cwd()``

## Reference Documentation

`babel-plugin-transform-define` can transform certain types of code as a babel transformation.

#####`Identifiers`

*.babelrc*
```json
{
  "plugins": [
    ["transform-define", {
      "VERSION": "1.0.0",
    }]
  ]
}
```

*Source Code*
```js
VERSION;

window.__MY_COMPANY__ = {
  version: VERSION
};
```

*Output Code*
```js
"1.0.0";

window.__MY_COMPANY__ = {
  version: "1.0.0"
};
```
***
#####`Member Expressions`

*.babelrc*
```json
{
  "plugins": [
    ["transform-define", {
      "process.env.NODE_ENV": "production"
    }]
  ]
}
```

*Source Code*
```js
if (process.env.NODE_ENV === "production") {
  console.log(true);
}
```

*Output Code*
```js
if (true) {
  console.log(true);
}
```
***
#####`Unary Expressions`

*.babelrc*
```json
{
  "plugins": [
    ["transform-define", {
      "typeof window": "object"
    }]
  ]
}
```

*Source Code*
```js
typeof window;
typeof window === "object";
```

*Output Code*
```js
'object';
true;
```


***

## License

[MIT License](http://opensource.org/licenses/MIT)
npm package: @jcoreio/clarity-plugin-toolkit
Description: CLI to develop and deploy plugins for Clarity
Author: Andy Edwards
Latest version: 1.3.14

# `@jcoreio/clarity-plugin-toolkit`

This is a CLI that makes it easy to build and deploy your plugin to [Clarity](https://www.jcore.io/clarity).
It provides a managed webpack config and scripts to orchestrate the process of uploading the webpack bundles to Clarity.

## Getting Started

The easiest way to get started is to create a project with [`create-clarity-plugin`](https://github.com/jcoreio/clarity-plugin-toolkit/tree/master/packages/create-clarity-plugin):

```sh
npx create-clarity-plugin@latest
# or
yarn create clarity-plugin
# or
pnpm create clarity-plugin
# or
bunx create-clarity-plugin
```

Then in the project use `npm run dev` to start the [Dev Server](#dev-server).

## Dev Server

`npm exec clarity-plugin-toolkit dev` starts the dev server. (`create-clarity-plugin` adds a `dev` package script alias for this.)
On the first run it will create `.env` and `docker-compose.yml` files and ask you to fill out some fields in `.env`
(currently, you only need to set the hostname of our private AWS Elastic Container Repository).

Thereafter running `clarity-plugin-toolkit dev` will automatically start up
build watch processes and the Clarity docker container with your plugin from this project mounted into it. It will
automatically open Clarity in your browser once it's up and running!

The dev server supports Webpack [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) and
whenever you change client modules the changes should theoretically show up in the browser. However `react-refresh`
hasn't seemed reliable, at least not with the version of `react` Clarity is on. But changes should at least show up
after you refresh the page.

If you change backend modules, the dev server will restart the docker container as soon as possible with the new code.

## Updating the Clarity Docker image

Type a newer version in the app image tag in the `docker-compose.yml` generated by the [`dev` command](#dev-server).
Then run `npm exec clarity-plugin-toolkit pull-image` to pull it. This command logs into the AWS Elastic Container Repository
before pulling the image.

## AWS Credentials

The [`dev`](#dev-server) and [`pull-image`](#updating-the-clarity-docker-image) commands use AWS SDK credentials
found in your environment (e.g. `~/.aws/credentials`). You can manually specify credentials via the
`AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` environment variables or use the `AWS_PROFILE` environment variable
to specify which profile in your `~/.aws/credentials` to use.

## Deploying

Run `npm exec clarity-plugin-toolkit deploy` to begin the interactive plugin deployment process.
(`create-clarity-plugin` adds a `deploy` package script alias for this.)
First the CLI will ask you for the URL of your Clarity deployment.
Then, it will have you create a code signing key in Clarity.
Finally, it will rebuild the webpack bundles if necessary and upload them to Clarity via its REST
API.
npm package: @jcoreio/commitlint-config
Description: my commitlint config
Author: Andy Edwards
Latest version: 1.1.1

# commitlint-config

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

my commitlint config

## Usage

```sh
npm install --save commitlint-config
```
npm package: @jcoreio/condition-solano
Description: Check Solano CI environment before publishing
Author: Stephan Bönnemann
Latest version: 1.0.0

# @jcoreio/condition-solano

[semantic-release](https://github.com/semantic-release/semantic-release) plugin to check [Solano CI](https://solanolabs.com/) environment before publishing.

[![Travis](https://img.shields.io/travis/jcoreio/condition-travis.svg)](https://travis-ci.org/jcoreio/condition-travis)
[![Codecov](https://img.shields.io/codecov/c/github/jcoreio/condition-solano.svg)](https://codecov.io/gh/jcoreio/condition-solano)
[![Greenkeeper badge](https://badges.greenkeeper.io/jcoreio/condition-solano.svg)](https://greenkeeper.io/)

Verify that `semantic-release` is running:
-   on Solano CI
-   on the right git branch and not on a PR build

### Options

| Option                | Description                                                          | Default                                                |
| --------------------- | -------------------------------------------------------------------- | ------------------------------------------------------ |
| `githubToken`         | **Required.** The Github token used to authenticate with Travis API. | `process.env.GH_TOKEN` or `process.env.GITHUB_TOKEN`   |
| `githubUrl`           | The GitHub Enterprise endpoint.                                      | `process.env.GH_URL` or `process.env.GITHUB_URL`       |
| `githubApiPathPrefix` | The GitHub Enterprise API prefix.                                    | `process.env.GH_PREFIX` or `process.env.GITHUB_PREFIX` |

## Configuration

The plugin is used by default by [semantic-release](https://github.com/semantic-release/semantic-release) so no specific configuration is required if `githubToken`, `githubUrl`, and `githubApiPathPrefix` are set via environment variable.

Always run `semantic-release` in a `post_build` hook so that it runs after all workers in the build matrix succeed.

```yml
nodejs:
  version: '8.9'

hooks:
  post_build: npm run semantic-release
```
npm package: @jcoreio/dst
Description: determine if a date is in daylight savings time
Author: Chris Dickinson
Latest version: 0.0.4

# dst.js

Is it daylight savings time?

Designed for use in node as well as in-browser.

## Date.prototype.isDST()

Returns true if the date is during daylight savings time.

## (window || require('dst')).is_dst(date, [thresholds])

Available either directly via `require` or on the window object, `is_dst`
is the function underlying the prototype method.

It accepts an additional `thresholds` argument, which should take the following
form:

````javascript
{
    "spring_forward":<integer offset from beginning of year in milliseconds>,
    "fall_back":<integer offset from beginning of year in milliseconds>,
}
````

> ### nota bene
> 
> `spring_forward` need not be *before* `fall_back` -- in fact, in 50% of earthly
> hemispheres, it's just the opposite situation.
>
> further, in other saner lands, there may be **no** thresholds to cross -- that is,
> there are happy, productive human beings that somehow survive without DST.
> in that case, both fields may be set to `0`.

## is_dst.find_thresholds()

Splits the year in two halves, and attempts to check at which point in the hemi-year
`Date#getTimezoneOffset` changes values. Run once during the execution of the program.
Uses a binary search -- cuts out at the granularity of one second.

May be used to provide valid `thresholds` to pass into `is_dst`, if so desired.

# testing

in node:

````

$ npm install --dev dst
$ npm test dst

````

in browser: [open this url](http://chrisdickinson.github.com/dst.js/test/)

or:

````

$ git clone git@github.com:chrisdickinson/dst.js.git
$ cd dst.js
$ python -m SimpleHTTPServer
$ open http://localhost:8000/test/

````

# LICENSE

MIT
npm package: @jcoreio/eslint-plugin-implicit-dependencies
Description: eslint plugin to detect implicit dependencies
Author: Leonard Martin
Latest version: 1.2.0

# @jcoreio/eslint-plugin-implicit-dependencies

eslint plugin to detect implicit dependencies

Detects when a module has been 'require'd or 'import'ed that is not listed as a dependency in the project's package.json.

This helps prevent accidentally depending on a module that is present in node_modules as a result of being installed further down your dependency tree, but is not listed as an explicit dependency of your project.

## Usage

Add `@jcoreio/eslint-plugin-implicit-dependencies` to the plugins section of your [ESLint configuration file](http://eslint.org/docs/user-guide/configuring#configuration-file-formats). You can omit the `eslint-plugin-` prefix:

```yaml
plugins:
  - @jcoreio/eslint-plugin-implicit-dependencies
```

Then configure the plugin under the rules section.

```yaml
rules:
  - @jcoreio/implicit-dependencies/no-implicit: error
```

## Options

By default `implicit-dependencies` will only look for dependencies in the `dependencies` section of your package.json. You can include dev, peer and optional dependencies by configuring the rule to include those sections as follows:

```yaml
rules:
  - @jcoreio/implicit-dependencies/no-implicit:
      - error
      - dev: true
        peer: true
        optional: true
```

Or if configuring with javascript:

```javascript
rules: {
  '@jcoreio/implicit-dependencies/no-implicit': [
    'error',
    { peer: true, dev: true, optional: true }
  ]
}
```

You can ignore specific modules by adding an `ignore` option:

```yaml
rules:
  - @jcoreio/implicit-dependencies/no-implicit:
      - error
      - ignore:
          - vscode
```
npm package: @jcoreio/gauges
Description: react gauge components
Author: Andy Edwards
Latest version: 6.6.0

# gauges

[![CircleCI](https://circleci.com/gh/jcoreio/gauges.svg?style=svg&circle-token=84c538f6763227c1cd2e6f8f3cefd2b50ede9e52)](https://circleci.com/gh/jcoreio/gauges)
[![Coverage Status](https://codecov.io/gh/jcoreio/gauges/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/gauges)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

## Installation

To install and run this project, follow these steps:

1. Clone the repository to your local machine using the following command:

   ```
   git clone https://github.com/jcoreio/gauges.git
   ```

2. Navigate to the project directory:

   ```
   cd gauges
   ```

3. Install the project dependencies:

   ```
   yarn install
   ```

4. Start the development server:

   ```
   yarn start
   ```

   The development server project should now be running at http://localhost:3000. To edit the content of the development server, edit `/demo/Root.js`.
npm package: @jcoreio/get-pg-config
Description: apply default postgres connection config from dotfiles and .pgpass
Author: Andy Edwards
Latest version: 1.0.1

# @jcoreio/get-pg-config

apply default postgres connection config from dotfiles and .pgpass

[![CircleCI](https://circleci.com/gh/jcoreio/get-pg-config.svg?style=svg)](https://circleci.com/gh/jcoreio/get-pg-config)
[![Coverage Status](https://codecov.io/gh/jcoreio/get-pg-config/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/get-pg-config)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40jcoreio%2Fget-pg-config.svg)](https://badge.fury.io/js/%40jcoreio%2Fget-pg-config)

This solves two minor problems with `pg`'s default connection parameters:

- it doesn't read `~/.pgpass`/`PGPASSFILE`
- `user` defaults to the OS user. In our work we always use Docker and the `postgres` user,
  so we can configure that as the default with the following in `package.json` or `.get-pg-configrc` etc:
  ```json
  "get-pg-config": {
    "defaults": {
      "user": "postgres"
    }
  }
  ```
npm package: @jcoreio/graphql-sequelize-extra
Description: some missing pieces of the graphql-sequelize bridge
Author: Andy Edwards
Latest version: 2.0.0

# @jcoreio/graphql-sequelize-extra

[![CircleCI](https://circleci.com/gh/jcoreio/graphql-sequelize-extra.svg?style=svg)](https://circleci.com/gh/jcoreio/graphql-sequelize-extra)
[![Coverage Status](https://codecov.io/gh/jcoreio/graphql-sequelize-extra/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/graphql-sequelize-extra)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/%40jcoreio%2Fgraphql-sequelize-extra.svg)](https://badge.fury.io/js/%40jcoreio%2Fgraphql-sequelize-extra)

some missing pieces of the graphql-sequelize bridge

# Installation

```sh
npm install --save @jcoreio/graphql-sequelize-extra
```

# API

## `associationFields(model, options)`

```js
const { associationFields } = require('@jcoreio/graphql-sequelize-extra')
```

Creates GraphQL fields for the given sequelize `model`'s `associations`.

### Arguments

#### `model: Class<Sequelize.Model<any>>`

#### `options: Object`

##### `options.getType: (model: Class<Sequelize.Model<any>>) => Object` (required)

Gets the GraphQL type for the given sequelize model.

##### `options.getArgs: (model: Class<Sequelize.Model<any>>) => Object` (optional)

Gets the GraphQL args for the given sequelize model.

##### `options.getResolver: (model: Class<Sequelize.Model<any>>, association: Sequelize.Association) => Function` (optional)

Gets the GraphQL `resolve` function for the given sequelize model and association.

### Returns

A plain object of GraphQL fields for the given `model`'s
`associations`.

### Advice

You should use `associationFields` within a `fields` thunk since it some
types it needs would fail to be defined if there are circular
associations:

```js
const { models } = sequelize

function getType(model) {
  return types[model.name]
}

const types = mapValues(
  models,
  (model) =>
    new graphql.GraphQLObjectType({
      name: model.name,
      fields: () => ({
        ...attributeFields(model),
        ...associationFields(model, { getType }),
      }),
    })
)
```

If you have circular associations, you should [use some form of
nested GraphQL query attack prevention](https://stackoverflow.com/questions/37337466/how-do-you-prevent-nested-attack-on-graphql-apollo-server).