Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bob

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bob

Convention-based build tool for Node.js projects.

  • 0.5.18
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48
decreased by-30.43%
Maintainers
1
Weekly downloads
 
Created
Source

Bob http://travis-ci.org/cliffano/bob

Convention-based build tool for Node.js projects.

This is handy for building (linting, testing the code, checking test code coverage, generating documentation, packaging artifact, etc) a Node.js project, with a minimal-or-zero configuration, by following a set of common convention.

There are two Bob modes, human and robot. By default Bob runs in human mode, generating output in human-readable format (e.g. test result in a plain text list). When robot mode is used, Bob will generate output in machine-parsable format (e.g. test result in XML), which is handy when you're using a continuous integration server that consumes XML files for rendering reports and charts.

Bob works where ever you can run make.

Installation

npm install -g bob

Project Convention

A project must contain:

  • package.json file, with at least name and version info
  • lib/ directory, containing *.js source files
  • test/ directory, containing *.js test files

Usage

Run Bob from project directory: (same level as package.json file)

bob clean lint test coverage ...

Run Bob in robot mode: (if unspecified, BOB_MODE defaults to human)

BOB_MODE=robot bob clean lint test coverage

Run Bob with verbose output: (display make arguments and shell commands)

BOB_MODE=robot bob --verbose clean lint test coverage

Run Bob with specific environment: (if unspecified, NODE_ENV defaults to development)

NODE_ENV=production bob start

Targets

TargetDescriptionTypesParameters
depInstall dependencies specified in package.json file by executing npm install . .--
rmdepRemove dependencies in node_modules directory.--
updepUpgrade all dependencies to latest version. Only use this if you want exact dependencies.--
toolsGlobal install the tools used by Bob (e.g. jshint, nodelint, mocha, vows, etc).--
rmtoolsRemove global installation of those tools.--
cleanDelete .bob directory and *.log files.--
lintLint *.js files in lib/ and test/ directories.jshint (default), nodelint, esvalidatebin, opts, files
complexityRun code complexity checker against *.js files in lib/ directory.plato (default), jscheckstylebin, opts, files
testExecute unit test files in test/ directory. If {scripts.test} is configured in package.json, then npm test will be executed instead.mocha (default), buster, nodeunit, vowsbin, opts, files
coverageCheck code coverage.mocha (default), buster-istanbul, vowsbin, opts, files
test-integrationexperimentalExecute integration test files in test-integration/ directory.mocha (default), busterbin, opts, files
test-acceptanceexperimentalExecute acceptance test files in test-acceptance/ directory.mocha (default), cucumberbin, opts, files
docGenerate code documentation.dox-foundation (default)bin, opts, files
depgraphGenerate module dependencies graph.madge (default)bin, opts, files
packageCreate a package file in .bob/artifact/ directory, along with md5 and sha1 checksums of the artifact file.tar.gz (default), zipsrc, bin, opts
publishPublish artifact file to an artifact repository.npm (default), ivyivy: user, key, host, port, dir
sendSend the artifact file to a remote server.scp (default), ftpuser, key, host, port, dir
stopStop the app by executing node {name}.js stop . If scripts.stop is configured in package.json, then npm stop will be executed instead.--
startStart the app by executing node {name}.js start . If scripts.start is configured in package.json, then npm start will be executed instead.--
restartRestart the app by executing node {name}.js restart . If scripts.restart is configured in package.json, then npm restart will be executed instead.--
statusDisplay app status by executing node {name}.js status .--
versionupUpgrade patch version number in package.json file.--
versionup-minorUpgrade minor version number in package.json file.--
versionup-majorUpgrade major version number in package.json file.--
nukeKill all processes with command containing the word 'node' .--

Config

To override the default setting, create .bob.json file in project directory (same level as package.json file). Target type and parameters can be overridden, here are some examples:

To use nodelint instead of the default jshint when running bob lint:

{
  "lint": {
    "type": "nodelint"
  }
}

To use nodelint instead of the default jshint, and to lint the files in src directory instead of the default lib and test directories, when running bob lint:

{
  "lint": {
    "type": "nodelint",
    "files": "src"
  }
}

To add an alias target (called build) which executes clean lint test coverage targets:

{
  "build": "clean lint test coverage"
}

Continuous Integration

###Travis CI

Configure Bob in .travis.yml file:

before_install: "npm install -g bob"
script: "bob clean lint test coverage"

###Jenkins CI

Configure Bob in a Jenkins job with shell script build step:

npm install -g bob
bob clean lint test coverage

Keywords

FAQs

Package last updated on 14 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc