UNPKG
@akameco/generator-nm
Version:
latest (5.9.0)
5.9.0
5.8.1
5.8.0
5.7.0
5.6.0
5.5.1
5.5.0
5.4.0
5.3.0
5.2.0
5.1.0
5.0.2
5.0.1
5.0.0
4.2.0
4.1.1
4.1.0
4.0.2
4.0.1
Scaffold out a node module
akameco/generator-nm
@akameco/generator-nm
/
app
/
templates
/
index.js
11 lines
(8 loc)
•
266 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
// @flow
'use strict'
module
.
exports
=
(
input
/*: string */
, opts
/*: { postfix: ?string } */
= {}
) =>
{
if
(
typeof
input !==
'string'
) {
throw
new
TypeError
(
`Expected a string, got
${
typeof
input}
`
) }
return
`
${input}
&
${opts.postfix ||
'rainbows'
}
`
}