Generate a new Lerna package based on a template source directory. All source file names and content are evaluated for Handlebars (with registered helpers) tag expressions. The following custom helpers are also available:
kebabcase
– convert string to kebab casepluralize
– convert word to plural formsingularize
– convert word to singular formsnakecase
– convert string to snake casestartcase
– convert string to start case
import { lernaNew } from '@zendeskgarden/scripts';
import { tmpdir } from 'os';
const args: {
src: string;
dest: string;
tags?: Record<string, string>;
} = {
src: __dirname,
dest: tmpdir()
/* optional overrides */
};
(async () => {
const result = await lernaNew(args);
if (result) {
const { src, dest } = result;
console.log(src, dest);
}
})();
src
template source directory.dest
package destination directory.tag
<name>=<value> tags for template substitution.
garden lerna-new [--tag <tags...>] <src> <dest>