Skip to content
Library for detecting project types
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
plugins
.gitignore
.resinci.yml
CHANGELOG.md
LICENSE
README.md
package-lock.json
package.json

README.md

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.

You can’t perform that action at this time.