How to use the pkg.name function in pkg

To help you get started, we’ve selected a few pkg 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 smallwins / lambda / scripts / deps.js View on Github external
dirs.forEach(dir=> {
  var pkg = join(dir, 'package.json')
  var json = require(pkg)
  console.log(chalk.green(' λ '))
  console.log(chalk.green(' λ ') + chalk.underline.dim.cyan(json.name))
  if (json.dependencies) {
    Object.keys(json.dependencies).forEach(k=> {
      var f = lodash.padEnd(` - ${k}`, 30, '.')
      var l = lodash.padStart(`${json.dependencies[k]}`, 11, '.')
      console.log(chalk.green(' λ ') + chalk.dim(f) + chalk.dim.yellow(l))
    })
  }
  if (json.devDependencies) {
    Object.keys(json.devDependencies).forEach(k=> {
      var f = lodash.padEnd(` - ${k}`, 30, '.')
      var l = lodash.padStart(`${json.devDependencies[k]}`, 11, '.')
      console.log(chalk.green(' λ ') + chalk.dim(f) + chalk.dim.yellow(l))
    })
  }
  if (!json.dependencies && !json.devDependencies) {
    console.log(chalk.green(' λ ') + chalk.dim(' x no deps'))
github northbrookjs / northbrook / lib / subcommand / release / changelogs.js View on Github external
packages.forEach(function (packageName) {
    const packageDir = join(rootDir, packageName)
    const filename = join(packageDir, '/CHANGELOG.md')

    const pkg = join(packageDir, 'package.json')

    const name = require(pkg).name

    touchFile(filename, function () {
      const changelogOpts = {
        preset: 'angular',
        releaseCount: 0,
        pkg: {
          path: pkg
        },
        transform: function (commit, cb) {
          if (commit.scope === name) {
            cb(null, commit)
          } else {
            cb()
          }
        }
      }
github architect / architect / src / env / _write.js View on Github external
function _stage(callback) {
            var pkg = ''
            var name = require(pkg).name.replace(app, '')
            var FunctionName = `${app}-staging-${name}`
            callback()
          },
          function _production(callback) {