deployment-type
Version:
Determine the potential deployment type of a project on Now
46 lines (29 loc) • 1.71 kB
Markdown
# deployment-type
[](https://travis-ci.org/zeit/deployment-type)
[](https://github.com/sindresorhus/xo)
[](https://zeit.chat/)
This [Node.js](https://nodejs.org/en/) package inspects a certain file or directory path of your choice and then responds with the deployment type that will be selected for it when deployed with [now](https://zeit.co/now).
All of ZEIT's [now](https://zeit.co/now) clients (like [Now Desktop](https://github.com/zeit/now-desktop) and [Now CLI](https://github.com/zeit/now-cli)) are using this package.
## Usage
Firstly, install the package:
```bash
yarn add deployment-type
```
And then:
```js
// Load it
const deploymentType = require('deployment-type')
// Call it and pass it a directory or file path
await deploymentType(<path-here>)
```
### Types
The package will return one of these deployment types:
- "npm" (node deployment)
- "static"
- "docker"
## Contribute
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Within the module you want to test your local development instance of the package, just link it to the dependencies: `npm link deployment-type`. Instead of the default one from npm, node will now use your clone of the package!
## Author
Leo Lamprecht ([@notquiteleo](https://twitter.com/notquiteleo)) - [▲ZEIT](https://zeit.co)