How to use the npm.localPrefix function in npm

To help you get started, we’ve selected a few npm 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 Gottwik / Enduro / libs / theme_manager / theme_manager.js View on Github external
npm.commands.install(theme_progress_variables.answers.project_name, npm_dependencies, function (err, data) {
						if (err) { console.log(err) }

						// trick npm into believeing it's in the theme's folder
						npm.localPrefix = path.join(process.cwd(), theme_progress_variables.answers.project_name)

						// run postinstall script
						npm.commands.run(['postinstall'], function (err) {
							if (err) { console.log(err) }

							// no need to silence npm, enable console.log
							console.log = log_temp
							logger.loaded()
							resolve()
						})

					})
				})
github auth0 / auth0-authorization-extension / tests / integration / remote.js View on Github external
npm.load((err) => {
  if (err) throw err;

  npm.localPrefix = path.join(__dirname, '../..');
  npm.commands.run([ 'extension:build' ], (err) => {
    if (err) throw err;

    const code = fs.readFileSync(`./dist/auth0-authz.extension.${EXTENSION_VERSION}.js`).toString();

    async.eachSeries(containers, (container, callback) => {
      const profile = Sandbox.init({
        url: 'https://sandbox.it.auth0.com',
        token: WEBTASK_TOKEN,
        container: WEBTASK_CONTAINER
      });

      logger.debug(`Uploading code for ${container.name}`);

      profile.create(code, {
        secrets: container.env,
github apmjs / apmjs / src / utils / npm.js View on Github external
get: () => {
      return npm.localPrefix
    }
  },