diff --git a/readme.md b/readme.md index 5cd727d9..b1730abc 100644 --- a/readme.md +++ b/readme.md @@ -75,6 +75,7 @@ $ np --help --no-yarn Don't use Yarn --contents Subdirectory to publish --no-release-draft Skips opening a GitHub release draft + --no-2fa Don't enable 2FA on new packages Examples $ np diff --git a/source/cli.js b/source/cli.js index 5ebb2f3b..91ac87ba 100755 --- a/source/cli.js +++ b/source/cli.js @@ -31,6 +31,7 @@ const cli = meow(` --no-yarn Don't use Yarn --contents Subdirectory to publish --no-release-draft Skips opening a GitHub release draft + --no-2fa Don't enable 2FA on new packages Examples $ np @@ -70,6 +71,10 @@ const cli = meow(` }, preview: { type: 'boolean' + }, + '2fa': { + type: 'boolean', + default: true } } }); diff --git a/source/index.js b/source/index.js index 3d5be812..9ac60620 100644 --- a/source/index.js +++ b/source/index.js @@ -215,7 +215,7 @@ module.exports = async (input = 'patch', options) => { ]); const isExternalRegistry = npm.isExternalRegistry(pkg); - if (options.availability.isAvailable && !options.availability.isUnknown && !pkg.private && !isExternalRegistry) { + if (options['2Fa'] && options.availability.isAvailable && !options.availability.isUnknown && !pkg.private && !isExternalRegistry) { tasks.add([ { title: 'Enabling two-factor authentication',