You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

buddy-cli

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 2.0.1

.travis.yml

166

index.js

@@ -1,9 +0,7 @@

var fs = require('fs')
, path = require('path')
, mkdirp = require('mkdirp')
, existsSync = fs.existsSync
var find = require('./lib/find')
, program = require('commander')
, useCli = require.main.filename.indexOf('buddy-cli') != -1
, Builder, builder, ver;
, useCli = ~require.main.filename.indexOf('buddy-cli')
, builder;
// Register for uncaught errors and clean up

@@ -18,64 +16,56 @@ process.on('uncaughtException', function(err) {

findBuddy();
find(useCli, function (err, Builder, version) {
if (err) throw err;
program
.version(ver)
.usage('[options] <command> [path/to/package.json || path/to/buddy.js || path/to/buddy.json]')
.option('-t, --targets [types]', 'optional comma separated list of target(s) to build [js,css,html]')
.option('-c, --compress', 'compress output for production deployment')
.option('-l, --lint', 'check output for syntax and logic errors')
.option('-r, --reload', 'reload all connected live-reload clients on file change during watch [ADD-ON buddy-server]')
.option('-s, --serve', 'create a webserver to serve static files during watch [ADD-ON buddy-server]')
.option('-S, --script', 'run script on build completion')
.option('-L, --lazy', 'convert js modules for lazy evaluation')
.option('-v, --verbose', 'print all messages for debugging');
program
.version(version)
.usage('[options] <command> [path/to/package.json || path/to/buddy.js || path/to/buddy.json]')
.option('-t, --targets [types]', 'optional comma separated list of target(s) to build [js,css,html]')
.option('-c, --compress', 'compress output for production deployment')
.option('-l, --lint', 'check output for syntax and logic errors')
.option('-r, --reload', 'reload all connected live-reload clients on file change during watch [ADD-ON buddy-server]')
.option('-s, --serve', 'create a webserver to serve static files during watch [ADD-ON buddy-server]')
.option('-S, --script', 'run script on build completion')
.option('-L, --lazy', 'convert js modules for lazy evaluation')
.option('-v, --verbose', 'print all messages for debugging');
program
.command('build [config]')
.description('build js and css sources')
.action(function(config){
builderFactory().build(config, getOptions());
});
program
.command('build [config]')
.description('build js, css, and html sources')
.action(function(config){
builder = new Builder();
builder.build(config, getOptions());
});
program
.command('watch [config]')
.description('watch js and css source files and build changes')
.action(function(config){
var opts = getOptions();
opts.watch = true;
builderFactory().watch(config, opts);
});
program
.command('watch [config]')
.description('watch js, css, html source files and build changes')
.action(function(config){
var opts = getOptions();
opts.watch = true;
builder = new Builder();
builder.watch(config, opts);
});
program
.command('deploy [config]')
.description('build compressed js and css sources')
.action(function(config){
var opts = getOptions();
opts.deploy = true;
builderFactory().deploy(config, opts);
});
program
.command('deploy [config]')
.description('build compressed js, css, and html sources')
.action(function(config){
var opts = getOptions();
opts.deploy = true;
builder = new Builder();
builder.deploy(config, opts);
});
program
.command('ls')
.description('list all previously created files and directories')
.action(function(){
builderFactory().list(getOptions());
});
program.parse(process.argv);
program
.command('clean')
.description('remove all previously created files and directories')
.action(function(){
builderFactory().clean(getOptions());
});
// Show help if no arguments or wrong command
if (!program.args.length
|| ('string' == typeof program.args[0]
&& !~['build', 'watch', 'deploy'].indexOf(program.args[0]))) {
program.help();
}
});
program.parse(process.argv);
// Show help if no arguments or wrong command
if (!program.args.length
|| ('string' == typeof program.args[0]
&& !~['build', 'watch', 'deploy', 'ls', 'clean'].indexOf(program.args[0]))) {
program.help();
}
/**

@@ -89,2 +79,3 @@ * Retrieve options object

lint: program.lint,
// Backwards compat
script: program.script || program.test,

@@ -101,57 +92,2 @@ lazy: program.lazy,

return options;
}
/**
* Walk directory tree from cwd to find nearest node_modules/buddy
*/
function findBuddy () {
var loc, dir, prnt;
var load = function (location) {
Builder = require(location);
// Set version number from local buddy install
ver = require(path.join(location, 'package.json')).version;
program.version(ver);
return;
};
// Loaded via buddy-cli
if (useCli) {
while (true) {
if (typeof dir !== "undefined" && dir !== null) {
prnt = path.resolve(dir, '..');
// Exit if we can no longer go up a level
if (prnt.toLowerCase() === dir.toLowerCase()) {
return;
} else {
dir = prnt;
}
// Start at current working directory
} else {
dir = process.cwd();
}
loc = path.join(dir, 'node_modules', 'buddy');
if (existsSync(loc)) {
return load(loc);
} else {
loc = null;
}
}
// Loaded via buddy
} else {
return load(path.join(require.main.filename, '../..'));
}
}
/**
* Builder instance factory
* @returns {Builder}
*/
function builderFactory () {
if (Builder) {
builder = new Builder();
return builder;
} else {
throw(useCli ? 'a local version of buddy wasn\'t found on this path' : 'buddy(1) tool not found');
}
}
{
"name": "buddy-cli",
"version": "1.1.0",
"version": "2.0.1",
"description": "The command-line bootstrapper for buddy",

@@ -8,6 +8,10 @@ "author": "popeindustries <alex@pope-industries.com>",

"dependencies": {
"commander": "2.6.0",
"commander": "2.8.1",
"promptly": "0.2.1",
"mkdirp": "0.5.0"
"recur-fs": "2.2.0"
},
"devDependencies": {
"should": "3.3.2",
"mocha": "*"
},
"main": "index.js",

@@ -20,6 +24,10 @@ "bin": {

},
"scripts": {
"test": "NODE_ENV=test mocha --reporter spec --require should",
"test-windows": "set NODE_ENV=test&&node.exe ./node_modules/mocha/bin/mocha --reporter spec --require should"
},
"repository": "https://github.com/popeindustries/buddy-cli.git",
"readmeFilename": "README.md",
"readme": "[![NPM Version](https://img.shields.io/npm/v/buddy-cli.svg?style=flat)](https://npmjs.org/package/buddy-cli)\n\n# buddy-cli\n\nThe **buddy-cli** allows local versions of the **buddy** command to be run directly from the command line without any additional setup. This allows different versions of the **buddy** tool to be run from different projects, without any conflict.\n\n## Installation\n\n```bash\n# If necessary, first uninstall your existing buddy global install\n$ npm -g uninstall buddy\n\n$ npm -g install buddy-cli\n```\n\n## Usage\n\n```text\nUsage: buddy [options] <command> [path/to/package.json || path/to/buddy.js || path/to/buddy.json]\n\nCommands:\n\n build [config] build js and css sources\n watch [config] watch js and css source files and build changes\n deploy [config] build compressed js and css sources\n ls list all previously created files and directories\n clean remove all previously created files and directories\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -t, --targets [types] optional comma separated list of target(s) to build [js,css,html]\n -c, --compress compress output for production deployment\n -l, --lint check output for syntax and logic errors\n -r, --reload reload all connected live-reload clients on file change during watch [ADD-ON buddy-server]\n -s, --serve create a webserver to serve static files during watch [ADD-ON buddy-server]\n -S, --script run script on build completion\n -L, --lazy convert js modules for lazy evaluation\n -v, --verbose print all messages for debugging\n```\n\nOnce installed, run **buddy** as described [here](https://github.com/popeindustries/buddy#readme)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011-2015 Pope-Industries &lt;alex@pope-industries.com&gt;\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n",
"readme": "[![NPM Version](https://img.shields.io/npm/v/buddy-cli.svg?style=flat)](https://npmjs.org/package/buddy-cli)\n\n# buddy-cli\n\nThe **buddy-cli** allows local versions of the **buddy** command to be run directly from the command line without any additional setup. This allows different versions of the **buddy** tool to be run from different projects, without any conflict.\n\n## Installation\n\n```bash\n# If necessary, first uninstall your existing buddy global install\n$ npm -g uninstall buddy\n\n$ npm -g install buddy-cli\n```\n\n## Usage\n\n```text\nUsage: buddy [options] <command> [path/to/package.json || path/to/buddy.js || path/to/buddy.json]\n\nCommands:\n\n build [config] build js and css sources\n watch [config] watch js and css source files and build changes\n deploy [config] build compressed js and css sources\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -t, --targets [types] optional comma separated list of target(s) to build [js,css,html]\n -c, --compress compress output for production deployment\n -l, --lint check output for syntax and logic errors\n -r, --reload reload all connected live-reload clients on file change during watch [ADD-ON buddy-server]\n -s, --serve create a webserver to serve static files during watch [ADD-ON buddy-server]\n -S, --script run script on build completion\n -L, --lazy convert js modules for lazy evaluation\n -v, --verbose print all messages for debugging\n```\n\nOnce installed, run **buddy** as described [here](https://github.com/popeindustries/buddy#readme)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011-2015 Pope-Industries &lt;alex@pope-industries.com&gt;\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n",
"license": "MIT"
}

@@ -26,4 +26,2 @@ [![NPM Version](https://img.shields.io/npm/v/buddy-cli.svg?style=flat)](https://npmjs.org/package/buddy-cli)

deploy [config] build compressed js and css sources
ls list all previously created files and directories
clean remove all previously created files and directories

@@ -30,0 +28,0 @@ Options:

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc