generate-dest
v0.1.4
Published
Prompts the user for the destination directory to use. Can be used from the command line when installed globally, or as plugin or sub-generator in your generator.
Downloads
6
Maintainers
Readme
generate-dest
Prompts the user for the destination directory to use. Can be used from the command line when installed globally, or as plugin or sub-generator in your generator.
What is generate?
Generate is a command line tool and developer framework for scaffolding out new GitHub projects using generators{generators.md} and tasks{tasks.md}. 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:
- Visit the generate project
- Visit the generate documentation
- Find generators on npm (help us author generators{micro-generators.md})
Quickstart
CLI usage
Install globally with npm:
$ npm install --global generate-dest
You should now be able to run this generator's default task with the gen git
command. See all avallable tasks
API usage
Use as a plugin
Extend your own generator with the settings and features of generate-dest:
module.exports = function(app) {
app.use(require('generate-dest'));
};
Use as a sub-generator
Add this generator to a namespace in your generator:
module.exports = function(app) {
// you can use any arbitrary name to register the generator
app.register('dest', require('generate-dest'));
};
See the API docs for more detailed examples and descriptions.
CLI
Help
Get general help and a menu of available commands:
$ gen help
Running the dest
generator
Once both generate and generate-dest
are installed globally, you can run the generator with the following command:
$ gen dest
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.
Tasks
The following tasks are registered on the dest
generator.
prompt-dest
Prompts the user for the destination directory to use for writing files to the file system. If app.options.dest
is already defined, the task is skipped.
Example
$ gen dest:prompt-dest
dest
Alias for the prompt-dest task. (the default
task is run when no specific task name is given. This allows the prompt-dest
task be run with the $ gen dest
command)
Example
$ gen dest:default
# aliased as
$ gen dest
API
Install locally
If you want to use generate-dest
as a plugin or sub-generator to extend the features and settings in your own generator, you must first install it locally:
Install with npm:
$ npm install --save generate-dest
Use as a plugin
Use as a plugin if you want to extend your own generator with the features, settings and tasks of generate-dest
, as if they were created on your generator:
module.exports = function(app) {
app.use(require('generate-dest'));
};
Visit Generate's plugin docs to learn more about plugins.
Use as a sub-generator
Use as a sub-generator if you want to add generate-dest
to a namespace in your generator:
module.exports = function(app) {
// register the generate-dest with whatever name you want
app.register('foo', require('generate-dest'));
};
Visit Generate's sub-generator docs to learn more about sub-generators.
Related projects
You might also be interested in these projects:
- generate: Generate is a command line tool and developer framework for scaffolding out new GitHub projects… more | homepage
- generate-file: Generator for generating a single file from a template. | homepage
- generate-node: Generate a node.js project, with everything you need to begin writing code and easily publish… more | homepage
Contributing
This document was generated by verb-readme-generator (a verb generator), please don't edit directly. Any changes to the readme must be made in .verb.md. See Building Docs.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Or visit the verb-readme-generator project to submit bug reports or pull requests for the readme layout template.
Building docs
(This document was generated by verb-readme-generator (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
Generate readme and API documentation with verb:
$ npm install -g verb verb-readme-generator && 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 July 08, 2016.