open-index/open-npm huggingface dataset:
npm package: @jameslnewell/babel-preset
Description: A preset for my personal projects that use `babel`.
Latest version: 2.2.0

# @jameslnewell/babel-preset

A preset for my personal projects that use `babel`.

## Installation

```
yarn add --dev @jameslnewell/babel-preset
```

## Usage

`.babelrc`

```json
{
  "presets": ["@jameslnewell/babel-preset"]
}
```
npm package: @jameslnewell/buildkite-pipelines
Description: Generate Buildkite pipelines from code.
Author: James Newell
Latest version: 3.22.1

# @jameslnewell/buildkite-pipelines

Generate Buildkite pipelines from code.

![CI/CD](https://github.com/jameslnewell/buildkite-pipelines/actions/workflows/workflow.yml/badge.svg)

## Installation

NPM:

```bash
npm install @jameslnewell/buildkite-pipelines
```

Yarn:

```bash
yarn add --dev @jameslnewell/buildkite-pipelines
```

## Usage

Define your pipeline in code.

`./.buildkite/pipeline.js`

```ts
const {Pipeline, CommandStep} = require('@jameslnewell/buildkite-pipelines');

module.exports = new Pipeline().addStep(
  new CommandStep().setLabel('👋 Greeting').addCommand('echo "Hello World!"'),
);
```

Generate and upload your pipeline in a Buildkite step.

`./.buildkite/pipeline.yml`

```yaml
steps:
  - commands:
      - buildkite-pipelines ./.buildkite/pipeline.js | buildkite-agent pipeline upload
    plugins:
      - docker#v3.11.0:
          image: jameslnewell/buildkite-pipelines
```

### Transpiling Typescript

Define your pipeline in code.

`./.buildkite/pipeline.ts`

```ts
import {Pipeline, CommandStep} from '@jameslnewell/buildkite-pipelines';

export default new Pipeline().addStep(
  new CommandStep().setLabel('👋 Greeting').addCommand('echo "Hello World!"'),
);
```

Generate and upload your pipeline in a Buildkite step.

`./.buildkite/pipeline.yml`

```yaml
steps:
  - commands:
      - yarn global add ts-node
      - buildkite-pipelines -r ts-node/register ./.buildkite/pipeline.ts | buildkite-agent pipeline upload
    plugins:
      - docker#v3.11.0:
          image: jameslnewell/buildkite-pipelines
```

## Why?

This library is a very thin wrapper around [Buildkite's `yaml` syntax for defining a pipeline](https://buildkite.com/docs/pipelines/defining-steps). As such the value of this library is unlikely to be realised for simple one-file pipelines.

Consider using this library when:

- you're dynamically generating the pipeline and you require a programming language
- your pipeline is split across multiple `yaml` files and you're unable to use `yaml` anchors and aliases for composition across them
- you can't possibly live without typings

## Related projects

- https://hasura.io/blog/what-we-learnt-by-migrating-from-circleci-to-buildkite/
- https://docs.sourcegraph.com/dev/background-information/ci/development

### Development

1. Setup a pipeline - use the command for setting up a docker agent [here](https://buildkite.com/organizations/jameslnewell/agents?return_to_pipeline=buildkite-pipelines&welcome=true#setup-docker)
npm package: @jameslnewell/cancelable-promise
Description: A cancelable promise implementation.
Latest version: 1.0.2

# @jameslnewell/cancelable-promise 

A cancelable promise implementation.

##### Why?

Unlike other libraries:

* its your choice whether promises are resolved OR rejected
* `.cancel()` is chainable e.g. `promise.then(...).cancel()`

## Installation

```
yarn add @jameslnewell/cancelable-promise 
```

## Usage

```typescript
import CancelablePromise from '@jameslnewell/cancelable-promise';

const start = Date.now();

function delay() {
  return new CancelablePromise((resolve, reject) => {
    const timeout = setTimeout(resolve, 10000);
    return () => {
      clearTimeout(timeout);
      resolve();
    };
  });
}

function exit() {
  process.stdin.end();
  const finish = Date.now();
  const elapsed = (finish - start) / 1000;
  console.log(`Waited ${elapsed} seconds.`);
}

console.log('Waiting 10s before exiting. Press RETURN to exit now.');

const waiting = delay().then(exit, exit);

process.stdin.on('data', data => {
  waiting.cancel();
});
```
npm package: @jameslnewell/editor-config
Description: Contains an [`.editorconfig`](https://editorconfig.org/) according to my preferences.
Latest version: 3.0.0

# @jameslnewell/editor-config

Contains an [`.editorconfig`](https://editorconfig.org/) according to my preferences.

## Installation

NPM:

```bash
npm i -D @jameslnewell/editor-config
cp node_modules/editor-config/.editor-config .editor-config
```
npm package: @jameslnewell/eslint-config
Description: A [`eslint`](https://eslint.org/) config according to my preferences.
Latest version: 1.0.0

# @jameslnewell/eslint-config

A [`eslint`](https://eslint.org/) config according to my preferences.

## Installation

```
npm install --dev eslint @jameslnewell/eslint-config
```

## Usage

Create `eslint.config.mjs`:

```js
export config from '@jameslnewell/eslint-config';

export default config;
```

Update `package.json`:

```json
{
  "scripts": {
    "lint": "eslint ."
  }
}
```

## configs

- `@jameslnewell/eslint-config`
- `@jameslnewell/eslint-config/node`
npm package: @jameslnewell/eslint-config-react
Description: "eslint-plugin-jsx-a11y": "^6.4.1",     "eslint-plugin-react": "^7.26.1",     "eslint-plugin-react-hooks": "^4.2.0"
Latest version: 2.0.0

    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.26.1",
    "eslint-plugin-react-hooks": "^4.2.0"
npm package: @jameslnewell/git-utilities
Description: Utilities for working with `git`.
Author: James Newell
Latest version: 0.1.2

# @jameslnewell/git-utilities

Utilities for working with `git`.

## Usage

```ts
import { getMergeBase, getDiff } from "@jameslnewell/git-utilities";

const since = await getMergeBase("main", "my-branch");
const diff = await getDiff({ since });
```