Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async () => {
const result = await npmName.many(input);
const packages = await Promise.all([...result].map(async ([name, isAvailable]) => {
const ret = {name, isAvailable, isOrganization: organizationRegex.test(name)};
if (!isAvailable && !ret.isOrganization) {
ret.isSquatter = await squatter(ret.name);
}
return ret;
}));
spinner.stop();
for (const pkg of packages) {
log(pkg);
}