How to use the npm-install-checks.checkPlatform function in npm-install-checks

To help you get started, we’ve selected a few npm-install-checks 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 graalvm / graaljs / deps / npm / lib / install / validate-args.js View on Github external
'use strict'
var validate = require('aproba')
var asyncMap = require('slide').asyncMap
var chain = require('slide').chain
var npmInstallChecks = require('npm-install-checks')
var iferr = require('iferr')
var checkEngine = npmInstallChecks.checkEngine
var checkPlatform = npmInstallChecks.checkPlatform
var npm = require('../npm.js')

module.exports = function (idealTree, args, next) {
  validate('OAF', arguments)
  var force = npm.config.get('force')

  asyncMap(args, function (pkg, done) {
    chain([
      [hasMinimumFields, pkg],
      [checkSelf, idealTree, pkg, force],
      [isInstallable, pkg]
    ], done)
  }, next)
}

function hasMinimumFields (pkg, cb) {
github graalvm / graaljs / deps / npm / lib / install / action / refresh-package-json.js View on Github external
'use strict'

const Bluebird = require('bluebird')

const checkPlatform = Bluebird.promisify(require('npm-install-checks').checkPlatform)
const getRequested = require('../get-requested.js')
const npm = require('../../npm.js')
const path = require('path')
const readJson = Bluebird.promisify(require('read-package-json'))
const updatePackageJson = Bluebird.promisify(require('../update-package-json'))

module.exports = function (staging, pkg, log) {
  log.silly('refresh-package-json', pkg.realpath)

  return readJson(path.join(pkg.path, 'package.json'), false).then((metadata) => {
    Object.keys(pkg.package).forEach(function (key) {
      if (key !== 'version' && key !== 'dependencies' && !isEmpty(pkg.package[key])) {
        metadata[key] = pkg.package[key]
      }
    })
    if (metadata._resolved == null && pkg.fakeChild) {

npm-install-checks

Check the engines and platform fields in package.json

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis

Similar packages