detectorist

1.4.2 • Public • Published

Detectorist

Detectorist is a library containing heuristics for determining the type of project in a directory.

Install as a library

Run npm install --save detectorist to install Detectorist and add it to your package.json.

Install as a CLI

Run `npm install -g detectorist.

Usage

The CLI tool takes one argument, the path to the directory to check. Example:

$ detectorist .
#{
#  "node": true,
#  "npm": true,
#  "docker": true
#}

Usage as a library is extremely simple. Given the following directory located at ~/projects/foobar:

$ ls -l
package.json
package-lock.json
index.js

And the usage of Dectorist:

const detect = require('detectorist')

const path = '~/projects/foobar'

detect(path)

// returns
//
// {
//   npm: true,
//   node: true,
//   docker: false
// }

Detectorist will determine that it is a node project, not a Docker project, and (provided that private != true in the package.json) is also an npm project.

Readme

Keywords

none

Package Sidebar

Install

npm i detectorist

Weekly Downloads

1

Version

1.4.2

License

Apache-2.0

Unpacked Size

23.2 kB

Total Files

22

Last publish

Collaborators

  • balena.io