How to use the npm-profile.loginWeb function in npm-profile

To help you get started, we’ve selected a few npm-profile 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 entropic-dev / entropic / cli / lib / commands / login.js View on Github external
async function login(opts) {
  opts = loginOpts(opts);

  const { username, token } = await profile.loginWeb(
    async url => {
      console.log(`Here's your login url:\n  ${url}\nA browser window should open momentarily (If it doesn't, open the above link manually.)`);
      return opener(url);
    },
    opts
  );

  // load _just_ the config file, not the config file + env + cli args.
  const current = await load();

  current.registries = current.registries || {};
  current.registries[opts.registry] = current.registries[opts.registry] || {};
  current.registries[opts.registry].token = token;
  current.registries[opts.registry].username = username;

  await save(current);

npm-profile

Library for updating an npmjs.com profile

ISC
Latest version published 1 day ago

Package Health Score

89 / 100
Full package analysis

Similar packages