New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

generate-gitignore

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generate-gitignore

Generate a .gitignore file from the command line when Generate's CLI is installed globally, or use as a plugin or sub-generator in your own generator to make it a continuous part of the build workflow when scaffolding out a new project.

Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
175
21.53%
Maintainers
1
Weekly downloads
 
Created
Source

generate-gitignore NPM version NPM downloads Build Status

Generate a .gitignore file from the command line when Generate's CLI is installed globally, or use as a plugin or sub-generator in your own generator to make it a continuous part of the build workflow when scaffolding out a new project.

Table of Contents

(TOC generated by verb using markdown-toc)

Example

Templates are customizable and can be overridden.

generate-gitignore demo



What is "Generate"?

Generate is a command line tool and developer framework for scaffolding out new GitHub projects using generators and tasks. Answers to prompts and the user's environment can be used to determine the templates, directories, files and contents to build. Support for gulp, base and assemble plugins, and much more.

For more information about Generate:



Command line usage

Install globally

Installing the CLI

To run the gitignore generator from the command line, you'll need to install generate globally first. You can do that now with the following command:

$ npm install --global generate

This adds the gen command to your system path, allowing it to be run from any directory.

Install generate-gitignore

You may now install this module with the following command:

$ npm install --global generate-gitignore

Running generate-gitignore

You should now be able to run generate-gitignore with the following command:

$ gen gitignore

What will happen?

Running $ gen gitignore will run the generator's default task, which writes a .gitignore file to the current working directory, or the specified directory.

What you should see in the terminal

If completed successfully, you should see both starting and finished events in the terminal, like the following:

[00:44:21] starting ...
...
[00:44:22] finished ✔

If you do not see one or both of those events, please let us know about it.

Help

To see a general help menu and available commands for Generate's CLI, run:

$ gen help

Running multiple generators

generate supports running multiple generators at once. Here is an example of a generator that works well with generate-gitignore.

generate-dest

Run generate-dest before this generator to prompt for the destination directory to use for generated files.

Example

generate-gitignore generate-dest example

API usage

Use generate-gitignore as a plugin in your own generator.

Install locally

Install with npm:

$ npm install --save generate-gitignore

Register as a plugin

Inside your own generator:

module.exports = function(app) {
  // register generate-gitignore as a plugin to add the gitignore
  // task to your own generator
  app.use(require('generate-gitignore'));
};

Run tasks

Programmatically run tasks from generate-gitignore.

module.exports = function(app) {
  // adds the `gitignore` task to your generator
  app.use(require('generate-gitignore'));

  // run the `gitignore` task
  app.task('default', 'gitignore');
};

Visit the generator docs to learn more about creating, installing, using and publishing generators.



Customization

The following instructions can be used to override settings in generate-gitignore. Visit the Generate documentation to learn about other ways to override defaults.

Destination directory

To customize the destination directory, install generate-dest globally, then in the command line prefix dest before any other generator names.

For example, the following will prompt you for the destination path to use, then pass the result to generate-gitignore:

$ gen dest gitignore

Overriding templates

You can override a template by adding a template of the same name to the templates directory in user home. For example, to override the .gitignore template, add a template at the following path ~/generate/generate-gitignore/templates/.gitignore, where ~/ is the user-home directory that os.homedir() resolves to on your system.

About

Contributing

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

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 July 14, 2016.

Keywords

boilerplate

FAQs

Package last updated on 15 Jul 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