open-index/open-npm huggingface dataset:
npm package: @medialit/thumbnail
Description: Creates thumbnails for your images and videos.
Author: The CodeLit Team
Latest version: 0.0.28

# Introduction

> Create thumbnails from your image and video files for your Node.js based application.

The generated thumbnails are going to be of `16:9` aspect ratio.

For generating thumbnails, this package uses ffmpeg (for videos) utilities, so make sure that is installed on your machine before using this package.

_Note: This module will always overwrite the thumbnail file, if already exists._

### Features

1. Promise based API
2. Supports both images and videos

## Install

```
npm install @medialit/thumbnail
```

**NOTE**: You need to have the following softwares installed on your machine to use this package. For Ubuntu, the command is listed.

```
apt install ffmpeg
```

## Usage

With default options

```
const mt = require('@medialit/thumbnail')

mt.forImage(
  './path/to/file.png',
  './path/to/thumb.png')
  .then(() => console.log('Success'), err => console.error(err))
```

## API

### forImage(source, destination, [options])

**source**

An absolute or relative path to the original image.

**destination**

An absolute or relative path to the thumbnail folder.

### forVideo(source, destination, [options])

**source**

An absolute or relative path to the original video.

**destination**

An absolute or relative path to the thumbnail folder.

## Debugging

Set the environment variable `DEBUG` to `true` to see logs.
npm package: @mediam/multer-gcs
Description: Multer storage engine to google cloud storage
Author: Mediameeting SAS
Latest version: 1.1.1

# Multer-GCS

Google Storage engine for multer

## Installation

```
npm i --save multer-gcs
```

## Usage

```javascript
const storage = multerGCS({
  // required <object or gcs instance>
  // @see @google-cloud/storage options
  // could be a configuration object or a google storage
  // instance
  gcs: {
    projectId: 'my-google-project-id'
  },
  // required
  // google cloud storage bucket name
  bucket: 'my-bucket',
  // optional (req, file)
  // contains `contentType` = file.mimetype if `setContentType` is true
  // @return object
  metadata: (req, { originalFilename }) => ({
    originalFilename
  }),
  // optional (req, file)
  // (default: originalFilename)
  // @return string
  filepath: (req, file) => `${Date.now().toString()}/my_file`,
  // optional (default=true)
  setContentType: true,
  // optional (default=false)
  isPublic: true,
  // optional (default=false)
  isPrivate: true
})

const upload = multer({
  storage
})

storage.on('error', (error) => {
  console.error('something went wrong during upload', error)
})

app.post('/upload', upload.single('file'), (req, res) => {
  res.send('uploaded file')
})
```
npm package: @mediaman/kss-to-json
Description: Output kss-node styleguide as JSON
Author: mediaman GmbH
Latest version: 1.0.0

# mm-kss-to-json
Output kss-node styleguide as JSON.
Works with [kss-node](https://github.com/kss-node/kss-node) >= v3.0.0-beta.18.

This project was inspired by the Gists of [resah](https://gist.github.com/resah/b7ca19e7115d0aa35c9bbe67950ac8b8) and [delebash](https://gist.github.com/delebash/df7a9249d034e2573057).

## License
MIT © [mediaman GmbH](https://mediaman.com/)
npm package: @mediaman/restart-all-ecs-tasks
Description: CLI tool to restart all ECS tasks inside a cluster
Author: mediaman GmbH
Latest version: 0.0.1

# restart-all-ecs-tasks

> CLI tool to restart all ECS tasks inside a cluster

This project was born out of the need to restart all ECS tasks automatically, without having duplicate service definitions.
 
The commend restarts all tasks inside a given cluster, one at a time. After stopping one tasks it waits until the ECS service has started a new tasks before it stops the next one.

## Installation

```
$ npm install -g @mediaman/restart-all-ecs-tasks
```

## Basic usage

You can restart all ECS tasks on a given cluster with the `restart-all-ecs-tasks` command:

```
$ restart-all-ecs-tasks -c arn:aws:ecs:region:1234567890123:cluster/environment
```

## Binary path

By default the `restart-all-ecs-tasks` commands executes the `aws` binary. If your environment is not configured properly and you need to specify the full path to the `aws` binary you can specify it using the `-b` or `--binary` option.

```
$ restart-all-ecs-tasks -c arn:aws:ecs:region:1234567890123:cluster/environment -b /usr/local/bin/aws
```
npm package: @mediaman/storybook-to-json
Description: Extracts stories from Storybook into JSON file.
Author: mediaman GmbH
Latest version: 0.1.0

# storybook-to-json
Extracts stories from [Storybook](https://storybook.js.org/) into a JSON file.

*Note:* Currently working for [Angular](https://angular.io/) projects, support for other frameworks is planned.

## Getting Started

Install storybook-to-json in a project that uses Storybook:

    npm install @mediaman/storybook-to-json --save-dev
    
Run with

    storybook2json --stories [directory] --out [file]

### --stories

Parameter `--stories` specifies which directory should be searched for files ending in `*.stories.ts`.

### --out

Parameter `--out` is the file name and path where the resulting json file shall be created.

## JSON

Generated JSON looks like this

    [{
         "kind" : "Welcome",
         "stories" : ["to%20Storybook"]
     },
     {
        "kind" : "Button",
        "stories" : ["with%20text", "with%20some%20emoji"]
    }]

## License
MIT © [mediaman GmbH](https://mediaman.com/)
npm package: @mediamartin/ts-gql-sdk
Description: Generate a complete GraphQL SDK from schema, generating all queries/mutations/subscriptions along the way.
Author: shotor
Latest version: 1.0.11

# ts-gql-sdk-gen

Generate a complete GraphQL SDK from schema, generating all queries/mutations/subscriptions along the way.

Basically hacks the following two great packages together:

- [GraphQL Code Generator](https://www.graphql-code-generator.com/)
- [GQL Generator](https://github.com/timqian/gql-generator)

## Usage

### Install

```sh
yarn global add @shotor/tsgqlsdk

# or install locally
yarn add -D @shotor/tsgqlsdk
```

### Run

Given schema file

```graphql
# Sample schema
type Query {
  user(id: Int!): User!
}

type User {
  id: Int!
  username: String!
  email: String!
  createdAt: String!
}
```

Run the program

```sh
tsgqlsdk /path/to/schema.graphql /path/to/destination
```

In the destination folder you will find the following folder structure

```
- /queries
- /mutations
- /subscriptions
- gql-sdk.ts
```

Make sure `graphql-request` is installed in your project.

```sh
yarn add graphql-request
```

Then import and use the `gql-sdk.ts` and use fully typed API:

```ts
import { GraphQLClient } from 'graphql-request'
import { getSdk } from '/path/to/destination/gql-sdk.ts'

const sdk = getSdk(new GraphQLClient('http://example.org/graphql'))

desribe('test user', () => {
  it('gets user', async () => {
    const ID = 300
    const result = await sdk.user({
      id: ID,
    })

    expect(result.id).toBe(ID)
  })
})
```

## License

MIT