Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/env node
"use strict";
const path = require("path");
const chalk = require("chalk");
const program = require("commander");
const strings = require("@freesewing/i18n").strings;
const { version } = require("../package");
const getDefaultLibraryParams = require("./get-default-library-params");
const createLibrary = require("./create-library");
const promptLibraryParams = require("./prompt-library-params");
module.exports = async () => {
const defaults = await getDefaultLibraryParams();
program
.name("create-freesewing-pattern")
.version(version)
.usage("[options] [package-name]")
.option("-d, --desc ", "package description")
.option("-a, --author ", "author's github handle", defaults.author)
.option("-l, --license ", "package license", defaults.license)
"use strict";
const inquirer = require("inquirer");
const validateNpmName = require("validate-npm-package-name");
const languages = require("@freesewing/i18n").languages;
const strings = require("@freesewing/i18n").strings;
const config = require("./config");
let languageChoices = [];
for (let l of Object.keys(languages)) {
languageChoices.push({
name: languages[l],
value: l,
short: languages[l]
});
}
module.exports = async opts => {
if (opts.name && !validateNpmName(opts.name).validForNewPackages) {
throw new Error(`invalid package name "${opts.name}"`);
}