npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-dogen

v0.1.10

Published

a fast & easy scaffold cli for any development (based on gulp)

Downloads

128

Readme

Dependency Status

Why Dogen - "Oneness of Scaffolding"

dogen is meant to be the scaffold-on-the-fly tool. Creating templates of files & directories of files for scaffolding should be easy. Sometimes, there's a need to copy & paste & change group of files (aka Modules). Currently, tools like yeoman provide impressive scaffold utilities, but sometimes there's a need to update the generators according to your project's guidelines - and that's not possible with yeoman. You're relied on the generator's author or creating your own. That's why I created dogen.

Be The Master of you own generators. zen enso

Install

$ npm install --save-dev gulp-dogen

Usage

var gulp = require('gulp');
var dogen = require('gulp-dogen');

dogen.config({
	templatesPath: 'gulp/templates',
	gulp: gulp
});

// This will create this gulp task as:
// gulp dogen --endpoint the-name-to-be-scaffolded
dogen.task('endpoint', 'src/server/api/');
dogen.task('ngmodule', 'src/client/app/');
dogen.task('ngservice', 'src/client/common/services/');

Then in terminal, you can start using this gulp task:

gulp dogen --endpoint guitars

This task will do the following:

  1. copy the "endpoint" directory from the "examples" directory to destination 'src/server/api'
  2. replace every instance of the word "endpoint" with "guitars" - in both file names & file contents

One More Destination Path

Sometimes, a sub destination path is required under the destination that was configured in the task function. The dogen shell task can have a 2nd argument, "path" which will be concatenated as a suffix to the destination value of the task. The following task: gulp dogen --endpoint guitars --path music places the new generated files/directories at: src/client/api/music. Please note: the path value can be any nested path including several directories.

The examples directory includes a template of endpoint.

API

  1. config -
    1. templatesPath - the source directory to lookup templates
  2. task - (returns pipeable gulp task)
    1. name-of-flag - the name of the flag to be used in the command line and also the string that will be replaced in the template's files.
    2. destination - the destination path that will be used to place the newly created files

Template Engine Variables

dogen relies on 2 simple variables:

  1. "variable" - surrounded with underscore, "_", this variable will be replaced with the value of "the-name-to-be-scaffolded".
  2. "=variable=" - surrounded with equals operator, "=", this variable will be "camel-cased" (any hypens will be dropped) and then replaced with the value of "the-name-to-be-scaffolded".

dogen(options)

The concept of simplicity in dogen is that you should put the name-of-flag anywhere in the file's & directories names and contents - so it will be replaced with the value of the-name-to-be-scaffolded.

options

dogen task method return a gulp task that can be used like a standard gulp task. gulp dogen --list displays all the localy available generators in the console.

License

MIT © orizens Bitdeli Badge