open-index/open-npm huggingface dataset:
npm package: @now-deno/ci
Description: Community builder for using deno on the ZEIT Now platform
Latest version: 0.1.0-2ce1691e1696d2af7abb5b0fc644eb1407152cfe

# now-deno

> Deno builder for Vercel - run Deno on `vercel`. 🦕 + λ = ❤️

This builder allows you to run [Deno](https://deno.land) as a lambda on `vercel`.

## Usage

If you're unfamiliar with `vercel` runtimes, please read the [runtime docs](https://vercel.com/docs/runtimes) first. This runtime can be used like any other Community Runtime.

```json
// vercel.json
{
  "functions": {
    "api/**/*.{j,t}s": {
      "runtime": "now-deno@0.4.0"
    }
  }
}
```

Note: You need `vercel` v17.x or above to use the above configuration.

```ts
// api/hello.ts
import {
  APIGatewayProxyEvent,
  APIGatewayProxyResult,
  Context,
} from 'https://deno.land/x/lambda/mod.ts';

export async function handler(
  event: APIGatewayProxyEvent,
  context: Context
): Promise<APIGatewayProxyResult> {
  return {
    statusCode: 200,
    body: `Welcome to deno ${Deno.version.deno} 🦕`,
    headers: {
      'content-type': 'text/html; charset=utf-8',
    },
  };
}
```

That's the simplest way to use this runtime!

## Advanced usage

### Specific Deno version

To use a specific version of Deno you can specify a environment variable in your `vercel.json`:

```json
// vercel.json
{
  "functions": {
    ...
  },
  "env": {
    "DENO_VERSION": "0.42.0"
  }
}
```

### Unstable mode

To use Deno's `unstable` mode you can specify the environment variable `DENO_UNSTABLE` in your `vercel.json`:

```json
// vercel.json
{
  "functions": {
    ...
  },
  "env": {
    "DENO_UNSTABLE": "true"
  }
}
```

### TS Config

To pass a custom config, you can specify the variable `DENO_CONFIG` in your `now.json`:

```json
// now.json
{
  "functions": {
    ...
  },
  "env": {
    "DENO_CONFIG": "tsconfig.json"
  }
}
```

### Custom pre-package script

You can place a `build.sh` function in the root of your deploy directory. This will be executed before the function is packaged up.

## `vercel dev`

> **`vercel dev` is currently only supported on macOS and Linux. It is not supported on Windows.**

If you have have `deno` installed in your path then you can use `vercel dev` with this runtime. It should work just like any other runtime.

## Credits

This was only possible due to the great work of [Andy Hayden](https://github.com/hayd) who made the first attempts at running [deno in a lambda function](https://github.com/hayd/deno-lambda).
npm package: @now-ims/fastify-datastore
Description: Plugin to share a common Google Cloud Datastore configuration across Fastify
Author: John Rodkey
Latest version: 1.1.0

# fastify-datastore

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Build Status](https://travis-ci.org/now-ims/now-fastify-datastore.svg?branch=master)](https://travis-ci.org/now-ims/now-fastify-datastore)

This plugin shares [Google Cloud Datastore](https://cloud.google.com/nodejs/docs/reference/datastore/1.4.x/) object, so you can easy use Datastore with Fastify.

## Install
```
yarn add @now-ims/fastify-datastore
npm i @now-ims/fastify-datastore -S
```
## Usage
Add it to you project with `register` and you are done!  
You can access the *Google Cloud Datastore* via `fastify.ds`.
```js
const fastify = require('fastify')

fastify.register(require('@now-ims/fastify-datastore'), {
    projectId: 'your-project-id',
    keyFilename: '/path/to/keyfile.json'
  })

fastify.listen(4331, err => {
  if (err) throw err
  console.log(`server listening on ${fastify.server.address().port}`)
})
```

In your route file you can simply do all gets, queries, scans e.g.:

```js
async function singleRoute(fastify, options) {
  fastify.get(
    '/users/:id',
    async (request, reply) => {
      let data
      const { id } = request.params;
      const key = fastify.ds.key({
          namespace: 'multi-tenant-customer',
          path: ['User', id]
      })
      try {
        data = await fastify.ds.get(key)
      } catch (e) {
         reply.send(e)
      }
      return { data[0] }
    },
  )
}
```

## License

Licensed under [MIT](./LICENSE).
npm package: @now-ims/fastify-firestore
Description: Plugin to share a common Google Cloud Firestore configuration across Fastify
Author: John Rodkey
Latest version: 1.0.0

# fastify-firestore

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Build Status](https://travis-ci.org/now-ims/fastify-firestore.svg?branch=master)](https://travis-ci.org/now-ims/fastify-firestore)

This plugin shares [Google Cloud Firestore](https://cloud.google.com/nodejs/docs/reference/firestore/0.13.x/) object, so you can easily use Firestore with Fastify.

## Install
```
yarn add @now-ims/fastify-firestore
npm i @now-ims/fastify-firestore -S
```
## Usage
Add it to you project with `register` and you are done!  
```js
const fastify = require('fastify')

fastify.register(require('@now-ims/fastify-firestore'), {
    projectId: 'your-project-id',
    keyFilename: '/path/to/keyfile.json'
  })

fastify.listen(4331, err => {
  if (err) throw err
  console.log(`server listening on ${fastify.server.address().port}`)
})
```
You can access the *Google Cloud Firestore* via `fastify.fs`.
In your route file you can simply do all gets, queries, transactions e.g.:

```js
async function singleRoute(fastify, options) {
  fastify.get(
    '/users/:id',
    async (request, reply) => {
      const { id } = request.params;
      const docRef = fastify.fs.doc(`users\${id}`)
      try {
        const doc = await docRef.get()
      } catch (e) {
         reply.send(e)
      }
      return { doc.data() }
    },
  )
}
```

## License

Licensed under [MIT](./LICENSE).
npm package: @now-ims/slugify
Description: Turn a string into a url friendly slug
Latest version: 1.0.0

# slugify

A simple package to create slugs from strings while keeping it DRY.
![](https://github.com/now-ims/slugify/workflows/ci/badge.svg)
![npm (scoped)](https://img.shields.io/npm/v/@now-ims/slugify?color=E55812)

## How to install

```
npm install @now-ims/slugify -S
```

## API

- `string` - **is required** the string you want to slugify
- `separator` - (_Default: `'-'`_) **optional** character to use as separator `+` is another good option

## How to use

```js
const slugify = require('@now-ims/slugify');
const assert = require('assert'); // not needed to work

let txt = 'This is a test ---';
let slug = slugify(txt);
assert.strictEqual(slug, 'this-is-a-test');

txt = "C'est déjà l'été.";
slug = slugify(txt);
assert.strictEqual(slug, 'c-est-deja-l-ete');

txt = 'Nín hǎo. Wǒ shì zhōng guó rén';
slug = slugify(txt);
assert.strictEqual(slug, 'nin-hao-wo-shi-zhong-guo-ren');

txt = 'jaja---lol-méméméoo--a';
r = slugify(txt);
assert.strictEqual(slug, 'jaja-lol-mememeoo-a');

txt = 'Ford F150 King Ranch';
slug = slugify(txt, '+');
assert.strictEqual(slug, 'ford+f150+king+ranch');

txt = 'Ford F-150 King Ranch';
slug = slugify(txt, '+');
assert.strictEqual(slug, 'ford+f-150+king+ranch');
```

## License

Licensed under [MIT](./LICENSE)

## Acknowledgements

This project is sponsored and maintained by:

- [Now IMS](https://nowims.com)