Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function build() {
console.log('building names_all.json');
console.time(colors.green('data built'));
// Start clean
shell.rm('-f', ['dist/names_all.json']);
let all = {};
// process one key at a time to reduce memory footprint
checkKeys.forEach(k => {
// count
console.log(` counting ${k}`);
let counted = {};
let handler = new osmium.Handler();
handler.options({ tagged_nodes_only: true });
handler.on('node', countEntity);
handler.on('way', countEntity);
handler.on('relation', countEntity);
`git push origin --tags`,
];
if (argv.dry) {
console.log(colors.yellow("dry run:") + " I would execute this:");
for (const command of gitCommands) {
console.log(" " + command);
}
} else {
for (const command of gitCommands) {
console.log(`executing "${colors.blue(command)}" ...`);
execSync(command, {cwd: rootDir});
}
}
console.log("");
console.log(colors.green("done!"));
console.log("");
process.exit(0);
], function (code) {
console.info(code ?
colors.red.bold('\ndocumentation publish failed.') :
colors.green('\ndocumentation published successfully.'));
exit(code);
});
};
updateNotifier({pkg}).notify();
function getPackageNames(pkg) {
const deps = Object.assign({}, pkg.dependencies, pkg.devDependencies);
return Object.keys(deps);
}
const cli = meow(`
${colors.green('Usage')}
$ ${colors.bold('starring')} ${colors.yellow('[input]')}
${colors.green('Options')}
${colors.bold.yellow('--all')} Star all the local packages listed in the package.json from current project. [Default: false]
${colors.bold.yellow('--global')} Star global packages.
${colors.green('Examples')}
$ ${colors.yellow.bold('starring')}
presents UI to select the packages you want to star.
$ ${colors.yellow.bold('starring colors')}
stars colors npm package on GitHub.
`);
async function handleStarring(token, packageNames, starAll = false) {
const packageDetails = await getPackageDetails(token, packageNames);
const starredName = packageDetails.filter(pd => pd.starred).map(pd => pd.name);
const unStarredPackages = packageDetails.filter(pd => !pd.starred);
if (!isEmpty(starredName)) {
if (starAll) {
console.log(colors.yellow.bold(
`👍 You have already starred ${colors.cyan(arrayToSentence(starredName))}`
));
if (dict[k][v][kvnd].tags) {
dict[k][v][kvnd].tags = sort(obj[kvnd].tags);
}
});
generateIndex(tree, dict);
Object.keys(dict).forEach(k => {
let entry = dict[k];
Object.keys(entry).forEach(v => {
generatePage(tree, dict, k, v);
});
});
console.timeEnd(colors.green(tree + ' written'));
}
'use strict';
const colors = require('colors/safe');
global._ = require('lodash');
global.moment = require('moment');
global.TEST = [];
global.ENV = process.env.NODE_ENV || 'development';
console.log(colors.green(`[ HAPI ARCH ] Environment >> ${ENV}`));
try {
if (version === null) {
throw new Error(
"Could not deduce version from node_modules or package.json. " +
"Please provide an explicit version",
);
}
const filename = await writeStub(
projectRoot,
packageName,
version,
overwrite,
files,
);
console.log(colors.green("✓\t%s@%s -> %s"), packageName, version, filename);
if (resolutionError) {
console.log(
colors.yellow(
"\t Unable to stub all files in '%s', " +
"so only created a stub for the main module (%s)"
),
packageName,
resolutionError.message,
);
}
return true;
} catch (e) {
console.log(
colors.red("❌\t%s%s': %s"),
packageName,
version ? "@"+version : "",
installCompilerSuccess: (template, compiler, version) =>
`${green('✔')} Installed ${compiler} [${template} v${version}]`,
legacyTemplateDeprecationWarning: (legacyType, newType) =>
TsCache.prototype.getCompiled = function (id, snapshot, transform) {
var name = this.makeName(id, snapshot);
this.context.info(blue("transpiling") + " '" + id + "'");
this.context.debug(" cache: '" + this.codeCache.path(name) + "'");
if (!this.codeCache.exists(name) || this.isDirty(id, false)) {
this.context.debug(yellow(" cache miss"));
var transformedData = transform();
this.codeCache.write(name, transformedData);
this.markAsDirty(id);
return transformedData;
}
this.context.debug(green(" cache hit"));
var data = this.codeCache.read(name);
this.codeCache.write(name, data);
return data;
};
TsCache.prototype.getSyntacticDiagnostics = function (id, snapshot, check) {
function printAvailableTemplates() {
print('Available templates:');
for (const template of availableInitTemplates) {
print(`* ${colors.green(template.name)}: ${template.description}`);
print(` └─ ${colors.blue(`cdk init --type=${template.name} --language=[${template.languages.join('|')}]`)}`);
}
}