How to use first-run - 5 common examples

To help you get started, we’ve selected a few first-run examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xxczaki / bitly-cli-client / cli.js View on Github external
try {
				// Delete all saved URLs
				db.unset('urls').write();
				console.log(chalk.green('Successfully deleted all saved URLs!'));
			} catch (error) {
				console.log(chalk.red('Error deleting saved URLs! Are you sure there are any?'));
				process.exit(1);
			}
		} else {
			process.exit(1);
		}
	})();
}

if (cli.flags.reset) {
	firstRun.clear();
	config.clear();

	console.log(chalk.green('Token deleted! Type `bitly` to configure a new one :)'));
}
github splash-cli / splash-cli / src / libs / commands / settings.js View on Github external
export default async (
  { size, directory, auth, folders } = {},
  { restore } = {}
) => {
  clear();

  if (restore) {
    frun.clear();
    printBlock(chalk`{green Settings restored.}`);
    quit();
  }

  const questions = [];
  const choices = ["raw", "full", "regular", "thumb"];

  // TODO: Add user authentication.

  // const authQuestion = {
  //   name: "_auth",
  //   message: "Access Token",
  //   default: config.get("auth-key"),
  //   validate: token => {
  //     const regex = /[a-z0-9]/g;
  //     return regex.test(token) ? true : "Invalid token";
github splash-cli / splash-cli / src / commands / settings.js View on Github external
.then(async ({ confirm }) => {
				if (confirm) {
					frun.clear();

					await clearSettings();

					printBlock(chalk`{yellow Settings Restored!}`);
				} else {
					printBlock(chalk`{red {bold Operation aborted!}}`);
				}
			})
			.catch((error) => {
github splash-cli / splash-cli / src / commands / settings.ts View on Github external
.then(({ confirm }: any) => {
					if (confirm) {
						frun.clear();

						clearSettings().then(() => {
							printBlock(chalk`{yellow Settings Restored!}`);
						});
					} else {
						printBlock(chalk`{red {bold Operation aborted!}}`);
					}
				})
				.catch((error: any) => {
github terkelg / ramme / app / src / main / analytics.js View on Github external
function init () {
  if (firstRun()) {
    insight.track('install')
  }

  if (firstRun({name: `${pkg.name}-${pkg.version}`})) {
  }
}

first-run

Check if it's the first time the process is run

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular first-run functions