Socket
Book a DemoInstallSign in
Socket

base-scaffold

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-scaffold

Base plugin that adds support for generating files from a declarative scaffold configuration.

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

base-scaffold NPM version NPM downloads Build Status

Base plugin that adds support for generating files from declarative scaffold configurations.

Install

Install with npm:

$ npm install base-scaffold --save

Usage

Can be used with any base application. See example base applications.

var scaffold = require('base-scaffold');

Example

This example shows generate, but this plugin can be used with any base application.

var Generate = require('generate');
var Scaffold = require('scaffold');
var scaffold = new Scaffold();
var app = generate();

/**
 * Add a basic "target" to our scaffold. Scaffolds are like
 * grunt "tasks" and can have any number of targets
 */

scaffold.addTarget('abc', {
  options: {
    pipeline: generate.renderFile,
    data: {
      site: { title: 'My Blog' }
    }
  },
  src: 'templates/*.hbs',
  dest: 'site',
});

/**
 * Template engine for rendering handlebars templates
 */

app.engine('hbs', require('engine-handlebars'));

/**
 * Generate the scaffold!
 */

app.scaffold(scaffold)
  .on('error', console.error)
  .on('data', console.log)
  .on('end', function() {
    console.log('done!');
  });

See the scaffold library for additional information.

API

.scaffold

Generate files from a declarative scaffold configuration and return a stream.

Params

  • scaffold {Object}: Scaffold configuration object.
  • cb {Function}: Optional callback function. If not passed, .scaffoldStream will be called and a stream will be returned.

Example

var Scaffold = require('scaffold');
var scaffold = new Scaffold({
  options: {cwd: 'source'},
  posts: {
    src: ['content/*.md']
  },
  pages: {
    src: ['templates/*.hbs']
  }
});

app.scaffold(scaffold, function(err) {
  if (err) console.log(err);
});

.scaffoldStream

Generate files from a declarative scaffold configuration.

Params

  • scaffold {Object}: scaffold configuration object.
  • returns {Stream}: returns a stream with all processed files.

Example

var Scaffold = require('scaffold');
var scaffold = new Scaffold({
  options: {cwd: 'source'},
  posts: {
    src: ['content/*.md']
  },
  pages: {
    src: ['templates/*.hbs']
  }
});

app.scaffoldStream(scaffold)
  .on('error', console.error)
  .on('end', function() {
    console.log('done!');
  });

Base apps

The following projects are built on base.

  • assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
  • generate: Fast, composable, highly extendable project generator with a user-friendly and expressive API. | homepage
  • update: Easily keep anything in your project up-to-date by installing the updaters you want to use… more | homepage
  • verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.

This file was generated by verb, v0.9.0, on May 11, 2016.

FAQs

Package last updated on 11 May 2016

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