open-index/open-npm huggingface dataset:
npm package: @platoai/log
Description: Custom Winston logger format used by Plato AI.
Author: William Myers
Latest version: 1.0.5

# platoai-log
[![npm version](https://badge.fury.io/js/%40platoai%2Flog.svg)](https://badge.fury.io/js/%40platoai%2Flog)

Custom Winston logger format used by Plato AI.

# installation 

```bash
npm i -S @platoai/log
```

# usage

_Optionally_ [export](http://unix.stackexchange.com/a/117470) the following shell environment variables:
- `PLATOAI_LOG_LEVEL`, to: `error`, `warn`, `info`, `verbose`, `debug`, _or_ `silly` (defaults to: `info`)
- `PLATOAI_LOG_IS_JSON`, to: `true` _or_ `false` (defaults to: `false`)

```
const logger = require('@platoai/log');
```

and then use it like [winston](https://github.com/winstonjs/winston):
```javascript
log.info("Hello, world.");
// logs: `info: [greeter] Hello, world.`
log.info("Hello, world.", {prefix: "greeter"});
```
npm package: @platoai/multer-gcs
Description: Streaming multer storage engine for Google Cloud Storage
Author: jahmed76
Latest version: 1.1.0

# multer-gcs

> [Multer](https://github.com/expressjs/multer) [storage engine](https://github.com/expressjs/multer/blob/master/StorageEngine.md) for [Google Cloud Storage](https://cloud.google.com/storage/).

Please read the official `@google-cloud/storage` [documentation](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/) for additional options.

## Installation

```
npm install @platoai/multer-gcs
```

## Usage

```javascript
const multer = require('multer');
const gcs = require('@platoai/multer-gcs');

const storage = gcs({
  filename: function(req, file, cb) {
    cb(null, file.fieldname + '-' + Date.now());
  },
  bucket: 'bucket-name',
  credentials: require('/path/to/keyfile.json'),
  // optional metadata to add to the file
  metadata: {
    contentType: 'audio/wav'
  },
  // optional, passed to the @google-cloudg/storage `getSignedUrl` method
  // defaults to:
  urlConfig: {
    action: 'read',
    expires: new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000),
  },
  // optional, see: https://cloud.google.com/storage/docs/access-control/lists
  // defaults to:
  acl: 'publicRead',
});

const gcsUpload = multer({storage: storage});

app.post('/upload', gcsUpload.single('file'), function(req, res, next) {
  res.send('File was uploaded successfully!');
});
```

#### configuration

You can also use environment variables for `@platoai/multer-gcs` parameters.

```bash
GCS_BUCKET='bucket-name'
GCLOUD_PROJECT='dummy-project'
GOOGLE_APPLICATION_CREDENTIALS='/path/to/keyfile.json'
```

All the official `@google-cloud/storage` authentication options should be
supported by the `gcs` method. For more information, read their
[documentation](https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/guides/authentication).

#### transformers

You can also pass an array of functions that return anything that implements the
[streaming interface](https://nodejs.org/api/stream.html) and they will be
applied before uploading the file to Google Cloud Storage.

```javascript
const gcs = require('@platoai/multer-gcs');
const sox = require('sox-stream');

const storage = gcs({
  bucket: 'bucket-name',
  transformers: [
    () => sox({output: {type: 'wav'}})
  ],
});
```

## License

[MIT](LICENSE)