Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhz-io/nhz-io-slush-m
https://github.com/nhz-io/nhz-io-slush-m
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nhz-io/nhz-io-slush-m
- Owner: nhz-io
- License: mit
- Created: 2017-11-24T23:49:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-25T07:01:34.000Z (about 7 years ago)
- Last Synced: 2024-05-02T02:19:30.896Z (8 months ago)
- Language: CoffeeScript
- Size: 91.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.litcoffee
- License: LICENSE
Awesome Lists containing this project
README
# Module generator (@nhz.io scoped)
[![Travis Build][travis]](https://travis-ci.org/nhz-io/nhz-io-slush-m)
[![NPM Version][npm]](https://www.npmjs.com/package/@nhz.io/slush-m)## Install
```bash
npm i -g slush @nhz.io/slush-m
```## Usage
```bash
mkdir mod && cd modslush @nhz.io/m
```## Literate Source
### Imports
> Builtins
path = require 'path'
> General
gulp = require 'gulp'
pump = require 'pump'
inquirer = require 'inquirer'> Gulp plugins
install = require 'gulp-install'
conflict = require 'gulp-conflict'
template = require 'gulp-template'
rename = require 'gulp-rename'> String utils imports
slugify = require 'slugify'
camelcase = require 'camelcase'## Default task
gulp.task 'default', ->
answers = await inquirer.prompt [
{
name: 'pkgName'
message: 'Package name?'> Strip scope prefix from default package name
default: (path.basename process.cwd()).replace /^(nhz-io-)?/, ''
}
{
name: 'pkgDescription'
message: 'Description?'
}
{
name: 'pkgVersion'
message: 'Version?'
default: '0.0.0'
}
{
type: 'confirm'
name: 'continue'
message: 'Continue?'
}
]return done() unless answers.continue
> Strip scope prefix from package name
answers.pkgName = answers.pkgName.replace(/^nhz-io-/, '')
> Slugify
answers.pkgNameSlug = slugify answers.pkgName, '-'
> Camel Case
answers.pkgNameCamelCase = camelcase answers.pkgName
> Generate package
pump [
gulp.src __dirname + '/templates/**/*'template answers
rename (f) -> if f.basename[0] is '_' then f.basename = ".#{ f.basename.slice 1 }"
conflict './'
gulp.dest './'
install()
]## Version 1.0.5
## License [MIT](LICENSE)[travis]: https://img.shields.io/travis/nhz-io/nhz-io-slush-m.svg?style=flat
[npm]: https://img.shields.io/npm/v/@nhz.io/slush-m.svg?style=flat