open-index/open-npm huggingface dataset:
npm package: @shoooe/derive
Description: Library to derive a type from another.
Author: Shoe
Latest version: 0.3.0

# Derive

[![npm version](https://badge.fury.io/js/@shoooe%2Fderive.svg)](https://badge.fury.io/js/@shoooe%2Fderive)

Utility type to generate a type from another with a special care for the DX.

You can see this tool as an _hardcode_ version of `Pick`.

Features:

- 😎 Type safe
- 🌱 Minimal & lightweight
- ⌨️​ Autocompletion for fields
- 💥 Automatically expands arrays and nullable/optional types
- 👀 Preview expanded types in intellisense
- 💫 Supports recursive & mutually recursive types
- ❓ Optional fields support
- 💋 Inspired by GraphQL

## Installation

```
yarn add @shoooe/derive
```

## Usage

### Basic usage

Let's say that we have a type `User` defined as:

```typescript
type User = {
  bestFriend: User | undefined;
  favoriteBook: Book | null;
  friends: User[] | undefined;
  id: number;
  name: string;
};

type Book = {
  author: User;
  isdn: number;
  synopsis: string | null;
  title: string | null | undefined;
  subtitle?: string | null;
};
```

We can derive a subset of its properties via:

```typescript
type Result = Derive<
  User,
  {
    id: true;
    name: true;

    // Automatically expands nullable & optional types, which means that `null`
    // and `undefined` will be added automatically to the resulting type if
    // they existed in the target type.
    bestFriend: {
      name: true;
    };

    // Automatically expands arrays as well
    friends: {
      name: true;

      // Supports mutually recursive types
      favoriteBook: {
        isdn: true;
        title: true;
        synopsis: true;
        author: {
          name: true;
        };
      };
    };
  }
>;
```

Which will result in:

```typescript
type Result = {
  id: number;
  name: string;
  bestFriend:
    | {
        name: string;
      }
    | undefined;
  friends:
    | {
        name: string;
        favoriteBook: {
          isdn: number;
          title: string | null | undefined;
          synopsis: string | null;
          author: {
            name: string;
          };
        } | null;
      }[]
    | undefined;
};
```

## Alternatives

- [ts-essentials](https://github.com/ts-essentials/ts-essentials): comprehensive library with a different style for `DeepPick` (it doesn't do automatic expansion)

## Credits

Special thanks to:

- [Perdoo](https://www.perdoo.com/) for sponsoring the initial research & implementation
- [Szaman](https://github.com/szamanr) for the initial code review
npm package: @shooontan/eslint-config
Description: ESLint config
Author: shooontan
Latest version: 0.0.3

# @shooontan/eslint-config

[![npm version](https://img.shields.io/npm/v/@shooontan/eslint-config.svg)](https://www.npmjs.com/package/@shooontan/eslint-config)
[![install size](https://packagephobia.com/badge?p=@shooontan/eslint-config)](https://packagephobia.com/result?p=@shooontan/eslint-config)
[![ci](https://github.com/shooontan/eslint-config/actions/workflows/ci.yml/badge.svg)](https://github.com/shooontan/eslint-config/actions/workflows/ci.yml)

Shared ESLint config.

## Install

```sh
# npm
npm install --save-dev @shooontan/eslint-config eslint prettier

# or yarn
yarn add --dev @shooontan/eslint-config eslint prettier
```

## Usage

```js
module.exports = {
  extends: ['@shooontan'],
};
```
npm package: @shooontan/eslint-config-ts
Description: ESLint config for TypeScript
Author: shooontan
Latest version: 1.0.0

# @shooontan/eslint-config-ts

[![npm version](https://img.shields.io/npm/v/@shooontan/eslint-config-ts.svg)](https://www.npmjs.com/package/@shooontan/eslint-config-ts)
[![install size](https://packagephobia.com/badge?p=@shooontan/eslint-config-ts)](https://packagephobia.com/result?p=@shooontan/eslint-config-ts)
[![ci](https://github.com/shooontan/eslint-config/actions/workflows/ci.yml/badge.svg)](https://github.com/shooontan/eslint-config/actions/workflows/ci.yml)

Shared ESLint config for TypeScript.

## Install

```sh
# npm
npm install --save-dev @shooontan/eslint-config-ts eslint prettier

# or yarn
yarn add --dev @shooontan/eslint-config-ts eslint prettier
```

## Usage

```js
module.exports = {
  extends: ['@shooontan/eslint-config-ts'],
};
```
npm package: @shooontan/google-home-notifier
Description: Pure JavaScript Google-Home notifier
Latest version: 0.0.5

# @shooontan/google-home-notifier

[![npm version](https://img.shields.io/npm/v/%40shooontan%2Fgoogle-home-notifier.svg)](https://www.npmjs.com/package/%40shooontan%2Fgoogle-home-notifier)
[![Build Status](https://travis-ci.org/shooontan/google-home-notifier.svg?branch=master)](https://travis-ci.org/shooontan/google-home-notifier)

Send notifications to Google Home.

This module is rewritten in TypeScript based on [google-home-notifier](https://github.com/noelportugal/google-home-notifier). We are freed of the need to build with node-gyp when run `npm install`.

## Install

```shell
# npm
$ npm install @shooontan/google-home-notifier

# or yarn
$ yarn add @shooontan/google-home-notifier
```

## Usage

```javascript
const GoogleHomeNotifier = require('@shooontan/google-home-notifier');

(async () => {
  const notifier = GoogleHomeNotifier();
  await notifier.create();

  const message = 'Hi!';
  await notifier.say(message);
})();
```

## Document

## GoogleHomeNotifier([options])

```javascript
  const notifier = GoogleHomeNotifier(options);
```

`options` arguments is optional.

- `options.device`: `string` device name. example `Google-Home`.
- `options.ip`: `string` Google Home device ip address.
- `options.lang`: `string` language code. [Google Document](https://cloud.google.com/speech-to-text/docs/languages)

### notifier.create()

```javascript
await notifier.create();
```

`notifier.create()` find out Google Home device ip address and auto set ip address to notifier instance.

If setting options.ip, `notifier.create()` does not need.

### notifier.say(message, [options])

```javascript
await notifier.say(message, options);
```

Send notification to Google Home.

- `message`: `string` notification text.
- `options`: `object`
  - `lang`: `string` same as GoogleHomeNotifier `options.lang`.
  - `speed`: `number` notification text speed. default `1`.

### notifier.play(mp3Url)

```javascript
await notifier.play(mp3Url)
```

Play mp3 with Google Home.

- `mp3Url`: `string` | `Array<string>`
npm package: @shooontan/tsconfig
Description: TypeScript config
Author: shooontan
Latest version: 0.0.1

# tsconfig

Shared TypeScript config.

## Install

```bash
# npm
npm install --save-dev @shooontan/tsconfig

# or yarn
yarn add --dev @shooontan/tsconfig
```

## Usage

```json
{
  "extends": "@shooontan/tsconfig",
  "compilerOptions": {
    "outDir": "dist",
    "target": "es2018",
    "lib": [
      "es2018"
    ]
  }
}
```
npm package: @shooontan/voicetext
Description: VoiceText Web API Client for Node.js
Latest version: 0.0.2

# @shooontan/voicetext

[![npm version](https://img.shields.io/npm/v/@shooontan/voicetext.svg)](https://www.npmjs.com/package/@shooontan/voicetext)
[![Build Status](https://travis-ci.org/shooontan/voicetext.svg?branch=master)](https://travis-ci.org/shooontan/voicetext)

Get audio data from [VoiceText](https://cloud.voicetext.jp/webapi) Web API.

## Install

```bash
# npm
$ npm install @shooontan/voicetext

# or yarn
$ yarn add @shooontan/voicetext
```

## Usage

```javascript
const fs = require('fs');
const voiceText = require('@shooontan/voicetext');

const apiKey = 'VoiceTextAPIKEY';
const vt = voiceText(apiKey);

(async () => {
  const text = 'おやすみ';
  const speaker = 'show';
  const bf1 = await vt.tts(text, speaker); // return Buffer
  const output1 = 'oyasumi.wav';
  fs.writeFile(output1, bf1, 'binary', error => {
    if (error) {
      console.log(error);
    }
  });

  const bf2 = await vt.mp3('ばいばい', 'haruka', {
    emotion: 'happiness',
    pitch: 160
  });
  const output2 = 'byebye.mp3';
  fs.writeFile(output2, bf2, 'binary', error => {
    if (error) {
      console.log(error);
    }
  });
})();
```

## Document

## voiceText(apiKey)

```javascript
const voiceText = require('@shooontan/voicetext');
const vt = voiceText('apiKey');
```

- apiKey: string

[https://cloud.voicetext.jp/webapi/api_keys/new](https://cloud.voicetext.jp/webapi/api_keys/new)

### vt.tts(text, speaker, [option])

```javascript
vt.tts(text, speaker, {...})
```

- text: `string` translated text.
- speaker: `string` speaker name.
  - `show`
  - `haruka`
  - `hikari`
  - `takeru`
  - `santa`
  - `bear`
- option: `object`
  - format: `string` data Format
    - `wav`
    - `ogg`
    - `mp3`
  - emotion: string
  - emotion_level: string
  - pitch: number
  - speaker: number
  - volume: number

vt.tts return audio buffer data from VoiceText WebAPI.

### vt.wav(text, speaker, [option])

```javascript
vt.wav(text, speaker, {...})
```

Same sa vt.tts, but option.format fix `wav`.

### vt.ogg(text, speaker, [option])

```javascript
vt.ogg(text, speaker, {...})
```

Same. option.format is `ogg`.

### vt.mp3(text, speaker, [option])

```javascript
vt.mp3(text, speaker, {...})
```

Same. option.format is `mp3`.

## VoiceText

[VoiceText official site](https://cloud.voicetext.jp/webapi)