You can see below the API reference of this module.
Inits a new npm
package.
- Object
options
: An object containing the following fields: name
(String): The package name. This is required.template
(String): The template name to be used (check outjs-templates
). Defaults tofunction-export
.exampleFile
(String): The example file path (default:example/index.js
).exampleTemplate
(String): The example template (default:"example"
).description
(String): The package description.dirname
(String): The path to the directory where to create the project (default: the current directory).pack
(Object): Thepackage.json
information.- Function
callback
: The callback function.
- EventEmitter An event emitter emitting the following events:
repo_created
(data): After the repository was created.package_written
(data): After the package.json was written.packy_done
(data): After the defaults inpackage.json
were set. Note you can do this usingpacky
.after_init_handler
(data): After theafterinit
handler was executed.git_add
(data): Aftergit add .
was executed.git_commit
(data): Aftergit commit ...
was executed.git_remote_add
(data): Aftergit remote add ...
was executed.