open-index/open-npm huggingface dataset:
npm package: @m99coder/mcharts
Description: micro charts based on D3 v4
Author: Marco Lehmann
Latest version: 0.1.0

# µcharts
micro charts based on d3 v4

[![Build Status](https://travis-ci.org/m99coder/mcharts.svg?branch=master)](https://travis-ci.org/m99coder/mcharts)
[![Coverage Status](https://coveralls.io/repos/github/m99coder/mcharts/badge.svg?branch=master)](https://coveralls.io/github/m99coder/mcharts?branch=master)

## Documentation

Have a look at the `typedoc` output [here](http://htmlpreview.github.io/?https://github.com/m99coder/mcharts/blob/master/docs/index.html).
npm package: @m9ch/global-this
Description: shim `global-this`
Latest version: 0.1.1

# @m9ch/global-this

[![npm version](https://badgen.net/npm/v/@m9ch/global-this)](https://npm.im/@m9ch/global-this) [![npm downloads](https://badgen.net/npm/dm/@m9ch/global-this)](https://npm.im/@m9ch/global-this)

Just another `globalThis` ponyfill.

## Install

via `pnpm`, `yarn` or `npm`:

```bash
pnpm add @m9ch/global-this
# or
yarn add @m9ch/global-this
# or
npm i -S @m9ch/global-this
```

## License

MIT &copy; [Mitscherlich](https://mitscherlich.me)
npm package: @m9ch/make-cancelable-promise
Description: Make any promise cancelable.
Latest version: 0.1.0

# @m9ch/make-cancelable-promise

[![npm version](https://badgen.net/npm/v/@m9ch/make-cancelable-promise)](https://npm.im/@m9ch/make-cancelable-promise) [![npm downloads](https://badgen.net/npm/dm/@m9ch/make-cancelable-promise)](https://npm.im/@m9ch/make-cancelable-promise)

Make any promise cancelable.

## Install

via `pnpm`, `yarn` or `npm`:

```bash
pnpm add @m9ch/make-cancelable-promise
# or
yarn add @m9ch/make-cancelable-promise
# or
npm i -S @m9ch/make-cancelable-promise
```

## Usage

```javascript
import { makeCancelablePromise } from '@m9ch/make-cancelable-promise'

const abort = new AbortController()

const cancelable = makeCancelablePromise(
  new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve('done')
    }, 1000)
  }),
  abort.signal
)

setTimeout(() => {
  cancelable.cancel('The operation was aborted')
}, 500)

// or with abort signal
abort.abort()

cancelable.promise
  .then(console.log)    // => undefined
  .catch(console.error) // => AbortError: The operation was aborted
```

## License

MIT &copy; [Mitscherlich](https://mitscherlich.me)
npm package: @m9ch/make-class-singleton
Description: Convert ES-Class into Singleton
Latest version: 0.1.0

# @m9ch/make-class-singleton

[![npm version](https://badgen.net/npm/v/@m9ch/make-class-singleton)](https://npm.im/@m9ch/make-class-singleton) [![npm downloads](https://badgen.net/npm/dm/@m9ch/make-class-singleton)](https://npm.im/@m9ch/make-class-singleton)

## Install

via `pnpm`, `yarn` or `npm`:

```bash
pnpm add @m9ch/make-class-singleton
# or
yarn add @m9ch/make-class-singleton
# or
npm i -S @m9ch/make-class-singleton
```

## Usage

### Use as factory function:

```ts
import { Singleton as makeSingleton } from '@m9ch/make-class-singleton'

class Foo {}

const Singleton = makeSingleton(Foo)

const foo = new Singleton()
const bar = new Singleton()
console.log(foo === bar) // true
```

### Use as `ClassDecorator`

> [!NOTE]
> If using [`TypeScript`](https://www.typescriptlang.org/), you might need to enable `compilerOptions.experimentalDecorators` in `tsconfig.json` or something like that.
>
> Here is an example:
> ```json
> {
>   "compilerOptions": {
>     "target": "esnext",
>     "module": "esnext",
>     "modeResolution": "node",
>     "experimentalDecorators": true
>   }
> }
> ```

```ts
import { Singleton } from '@m9ch/make-class-singleton'

@Singleton
class Foo {}

const foo = new Foo()
const bar = new Foo()
console.log(foo === bar) // true
```

## Options

- `container`: Where singleton instance should create and stored, default is a `WeakMap` object in this module.

> [!Note]
> It might be unsafe if using default instance container in multi-thread environment, such as nodejs in swarm mode, or `WebWorker`.
>
> By passing a thread shared `WeakMap` object may save (not verified).

## License

MIT &copy; [Mitscherlich](https://mitscherlich.me)