Giter Site home page Giter Site logo

egad's Introduction

egad

Compile a Git repo full of Handlebars templates

Basic Usage

const {scaffold} = require('egad');

scaffold('https://github.com/<your>/<repo>', '/path/to/destination/dir', {
  some: 'data',
  forYour: 'templates'
}, {
  // default options
  overwrite: true,
  offline: false,
  remote: 'origin',
  branch: 'master'
})
  .then(filepaths => {
    console.log(`Wrote files: ${filepaths}`);
  })

The entire repository at the given URL will be inspected for Handlebars templates, and those templates will be rendered at the corresponding path under your destination directory. Files not containing Handlebars templates will simply be copied.

If destination is omitted, it will default to the current working directory.

Details

  • Repos are stored in the user's XDG cache dir, or whatever XDG cache dir is available, or a temp dir as a last resort.
  • If offline is false, the repo will be either cloned or updated (if a working copy already exists).
  • If offline is true and the repo does not already exist, then you get an rejected Promise.
  • Use environment variable DEBUG=egad to see debug output
  • Requires a git executable
  • Requires Node.js v6 or greater

Known Issues

  • Does not copy binary files
  • No "errback"-style interface
  • How about writing some tests?

License

© 2017 Christopher Hiller. Licensed Apache-2.0.

egad's People

Contributors

boneskull avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hiimbex wolfy1339

egad's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.