Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: 0.0.2
Fetching contributors…

Cannot retrieve contributors at this time

101 lines (68 sloc) 3.414 kB

Asset

Asset manager for lazy people

Installation

$ npm install asset

Usage

  Usage: asset [command] [options]

  Commands:

    install <name ...>   installs the given asset <name ...>
    search  [query]      search available assets with optional [query]

  Options:

    -o, --out <dir>   output directory defaulting to ./public
    -V, --version     output program version
    -h, --help        display help information

Examples

Installing Several Assets

By default asset installs to ./public.

  $ asset raphael g.raphael g.pie

   install : raphael@1.4.7
   install : g.raphael@0.4.1
   install : g.pie@0.4.1
  download : raphael@1.4.7
  complete : raphael@1.4.7 public/raphael.js
  download : g.raphael@0.4.1
  complete : g.raphael@0.4.1 public/g.raphael.js
  download : g.pie@0.4.1
  complete : g.pie@0.4.1 public/g.pie.js

Install Destination

Tweak the output directory with -o, --out <dir>.

  $ asset raphael g.raphael g.pie -o public/javascripts

   install : raphael@1.4.7
   install : g.raphael@0.4.1
   install : g.pie@0.4.1
  download : raphael@1.4.7
  complete : raphael@1.4.7 public/javascripts/raphael.js
  download : g.raphael@0.4.1
  complete : g.raphael@0.4.1 public/javascripts/g.raphael.js
  download : g.pie@0.4.1
  complete : g.pie@0.4.1 public/javascripts/g.pie.js

Search Repository

We can search the repository with an optional query, listing available assets and their default versions:

 $ asset raphael

  install : raphael@1.4.7
 download : raphael@1.4.7
 complete : raphael@1.4.7 public/raphael.js

Configuration

By default options must be passed via the CLI, however asset will also check the ./.asset and ~/.assetJSON configuration files, so for example a project may set{ "out": "public/javascripts" }` if we are mainly working with javascript, however the CLI options will always take precedence.

The Repository

By default the repo bundled with asset is used, however the ~/.assets configuration file is checked first. Perhaps down the road if/when asset becomes more flexible a repo will be hosted, for now simply fork the project and send a pull request.

License

(The MIT License)

Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Jump to Line
Something went wrong with that request. Please try again.