Skip to content

Package JSON Reference

wagenet edited this page Sep 15, 2011 · 2 revisions

Sample package.json

{
  "name": "coffee-script",
  "version": "1.1.1",
  "description":  "Unfancy JavaScript",
  "author":       "Jeremy Ashkenas",
  "homepage":     "http://coffeescript.org",
  
  "directories": {
    "lib": []
  },
  
  "bpm:build": {
    "bpm_libs.js": {
      "files": []
    }
  }
}

Fields

name

Name of your project.

version

String with the version number of your pacakge.

description

Short text description of your package.

summary

More detailed package overview.

author

Name of the author.

homepage

Package homepage.

keywords

Array of keywords to describe your package.

licenses

Array of license hashes. Each hash has the following attributes:

  • type
  • url

main

Relative path to main JS file. (Used by Spade) Defaults to lib/main.js

bin

Hash of bin commands with relative path.

directories

Directory mappings for your project. Keys are 'lib', 'css', 'tests'. Values are relative path to the directory. 'lib' may be an array.

pipeline

Undocumented

bpm:build

Information on what files BPM should generate. Consists of a hash where key is the file name and the value is another hash. The value hash at minimum, must contain a files array listing all files that will be compiled to create the file.

"bpm_libs.js": {
  "files": [
    "lib"
  ]
}

bpm:provides

  • transport
  • minifier
  • preprocessors
  • postprocessors
  • format:SUFFIX SUFFIX is the format file suffix. For instance, a text file format would be defined as format:txt. The value is the relative path to the formatter.

Example:

"bpm:provides": {
  "transport": {
    "main": "spade/transport"
  }
}

bpm:use:transport

Specify a specific transport to be used by the package.

dependencies

Hash of dependencies. Key is dependency name, value is version matcher.

Clone this wiki locally