Socket
Socket
Sign inDemoInstall

berber

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

berber - npm Package Compare versions

Comparing version 1.0.6 to 1.1.0

4

index.js

@@ -7,2 +7,4 @@ const minimisted = require('minimisted')

// The main starts at the next tick to allow user to configure berber in the first tick
setImmediate(() => { minimisted(argv => berber.main(argv)) })
setImmediate(() => minimisted(argv => berber.instance.getConfig()
.then(() => { berber.main(argv) })
.catch(e => { console.log(e.stack || e) })))
{
"name": "berber",
"version": "1.0.6",
"version": "1.1.0",
"description": "Static site generator generator on top of gulp ecosystem",

@@ -33,3 +33,4 @@ "main": "index.js",

"chalk": "^1.1.3",
"find-root": "^1.0.0"
"find-root": "^1.0.0",
"pad-right": "^0.2.2"
},

@@ -36,0 +37,0 @@ "devDependencies": {

@@ -1,2 +0,2 @@

# berber v1.0.6
# berber v1.1.0

@@ -93,5 +93,17 @@ BADGES HERE

Then set the above script to `bin` property in your `package.json`. Then publish it to npm and your command works like the below:
Then set the above script to `bin` property in your `package.json`.
```json
{
...
"bin": {
"foobar": "index.js"
},
...
}
```
Then publish it to npm and your command works like the below:
```
./node_modules/.bin/foobar build # => builds your site

@@ -98,0 +110,0 @@ ./node_modules/.bin/foobar serve # => serves your site with builtin dev server

@@ -8,2 +8,3 @@ const path = require('path')

const findRoot = require('find-root')
const pad = require('pad-right')

@@ -13,3 +14,9 @@ bulbo.loggerTitle('berber')

class Berber extends EventEmitter {
constructor () {
super()
this.actions = []
}
/**
* The entry point of berber program.
* @param {object} argv

@@ -46,7 +53,6 @@ */

'action:help' () {
const version = this.getVersion()
this['action:version']()
const name = this.name
console.log(`
${name}@${version}
Usage:

@@ -56,5 +62,9 @@ ${name} -h|--help Shows the help message

${name} serve Serves all the assets at localhost
${name} build Builds all the assets to the dest
${name} build Builds all the assets to the dest`)
See https://npm.im/${name} for more details.`.trim())
this.actions.forEach(action => {
console.log(` ${name} ${pad(action.name, 12, ' ')} ${action.description}`)
})
console.log(`\nSee https://npm.im/${name} for more details.`)
}

@@ -70,15 +80,11 @@

'action:build' () {
this.getConfig().then(() => {
this.checkEmpty()
this.checkEmpty()
bulbo.build()
}).catch(e => console.log(e.stack || e))
bulbo.build()
}
'action:serve' () {
this.getConfig().then(() => {
this.checkEmpty()
this.checkEmpty()
bulbo.serve()
}).catch(e => console.log(e.stack || e))
bulbo.serve()
}

@@ -109,8 +115,5 @@

return bulbo
.cli
return bulbo.cli
.liftoff(this.name, { configName, configIsOptional, moduleIsOptional })
.then(({ config }) => {
this.emit('config', config)
})
.then(({ config }) => { this.emit('config', config) })
}

@@ -126,2 +129,6 @@

/**
* Gets the version number of the user project.
* @return {string}
*/
getVersion () {

@@ -152,2 +159,23 @@ return this.getUserPackage().version

/**
* Adds the action of the given name.
* @param {string} name The action name
* @param {string} description The description
* @param {Function} cb The action callback
*/
addAction (name, description, cb) {
if (typeof description === 'function') {
cb = description
description = ''
}
this[`action:${name}`] = cb
this.actions.push({ name, description })
}
/**
* Creates and returns bulbo's AssetFacade object.
* @param {string[]} args The list of the paths
* @return {AssetFacade}
*/
asset (...args) {

@@ -154,0 +182,0 @@ return bulbo.asset(...args)

@@ -18,1 +18,5 @@ const Berber = require('./berber')

exports.setLogger = logger => bulbo.setLogger(logger)
exports.action = (name, description, cb) => berber.addAction(name, description, cb)
// Access to internal berber instance
exports.instance = berber

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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