Coder Social home page Coder Social logo

plop-format-generator's Introduction

plop-format-generator

js-standard-style build status npm version

Plop generator for ad format scaffolding. Generates your formats and components folders.

Configuration

  1. Install plop globally in your system.
npm install -g plop
  1. Install plop and plop-format-generator locally in your project.
npm install --save-dev plop plop-format-generator
  1. In your plopfile.js, require the plop-format-generator module and pass the plop object and optionally some configuration.
var path = require('path');
module.exports = (plop) => {
  require('plop-format-generator', {
    basePath: path.resolve(__dirname, 'src', 'templates'),
    prefix: 'template'
  });
}

Configuration object

Attribute Default Description
basePath src/templates Path in which the generator will put the formats
prefix Adds a prefix to each generator followed by a :

Usage

Run plop to see the list of generators, or run plop [generator] to use that generator.

Available generators

  1. template:format: generates the initial format folder and defaults files, use index.js to import components and elements for the specific format.
> plop template:format
> Format name: Test Format

[CREATE] ./src/templates/testFormat/index.js
[CREATE] ./src/templates/testFormat/components.js
[CREATE] ./src/templates/testFormat/config.js
[CREATE] ./src/templates/testFormat/mockdata.js
[CREATE] ./src/templates/testFormat/index.scss
  1. template:component: generates a component folder with a ES6 class.
> plop template:component
> Component name: myNewComponent
> where would you like to put this component?
> edrBox

[CREATE] ./src/template/edrBox/components/myNewComponent/myNewComponent-view.js
[CREATE] ./src/template/edrBox/components/myNewComponent/myNewComponent-styles.scss

License

MIT

plop-format-generator's People

Contributors

cracdev avatar

Watchers

James Cloos avatar

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.