How to use the normalize-package-data.fixer function in normalize-package-data

To help you get started, we’ve selected a few normalize-package-data 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 underarmour / further-review / lib / providers / package_json_file_sign_off.js View on Github external
async getSignOffsFromFile(contents) {
    const githubHost = url.parse(this.self.html_url).hostname;
    let packageJson;
    try {
      packageJson = JSON.parse(contents);
      normalizePackageData.fixer.fixPeople(packageJson);
    } catch (err) {
      this.log.warn('Unable to parse package.json');
      this.log.warn(err);

      return [];
    }
    const maintainers = packageJson.maintainers || [];

    const logins = maintainers.map(m => {
      if (m.url) {
        const parsed = url.parse(m.url);

        if (githubHost === parsed.hostname) {
          const login = parsed.pathname.split('/')[1];
          if (login) {
            return login;
github npm / npm-registry-client / lib / publish.js View on Github external
module.exports = publish

var url = require('url')
var semver = require('semver')
var Stream = require('stream').Stream
var assert = require('assert')
var fixer = require('normalize-package-data').fixer
var concat = require('concat-stream')
var ssri = require('ssri')

function escaped (name) {
  return name.replace('/', '%2f')
}

function publish (uri, params, cb) {
  assert(typeof uri === 'string', 'must pass registry URI to publish')
  assert(params && typeof params === 'object', 'must pass params to publish')
  assert(typeof cb === 'function', 'must pass callback to publish')

  var access = params.access
  assert(
    (!access) || ['public', 'restricted'].indexOf(access) !== -1,
    "if present, access level must be either 'public' or 'restricted'"
github davidhealey / waistline / node_modules / npm / node_modules / npm-registry-client / lib / publish.js View on Github external
module.exports = publish

var url = require('url')
var semver = require('semver')
var crypto = require('crypto')
var Stream = require('stream').Stream
var assert = require('assert')
var fixer = require('normalize-package-data').fixer
var concat = require('concat-stream')

function escaped (name) {
  return name.replace('/', '%2f')
}

function publish (uri, params, cb) {
  assert(typeof uri === 'string', 'must pass registry URI to publish')
  assert(params && typeof params === 'object', 'must pass params to publish')
  assert(typeof cb === 'function', 'must pass callback to publish')

  var access = params.access
  assert(
    (!access) || ['public', 'restricted'].indexOf(access) !== -1,
    "if present, access level must be either 'public' or 'restricted'"
  )

normalize-package-data

Normalizes data that can be found in package.json files.

BSD-2-Clause
Latest version published 3 days ago

Package Health Score

92 / 100
Full package analysis

Similar packages