How to use the builtins.forEach function in builtins

To help you get started, we’ve selected a few builtins 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 npm / validate-npm-package-name / index.js View on Github external
if (name.trim() !== name) {
    errors.push("name cannot contain leading or trailing spaces")
  }

  // No funny business
  blacklist.forEach(function(blacklistedName){
    if (name.toLowerCase() === blacklistedName) {
      errors.push(blacklistedName + " is a blacklisted name")
    }
  })

  // Generate warnings for stuff that used to be allowed

  // core module names like http, events, util, etc
  builtins.forEach(function(builtin){
    if (name.toLowerCase() === builtin) {
      warnings.push(builtin + " is a core module name")
    }
  })

  // really-long-package-names-------------------------------such--length-----many---wow
  // the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch.
  if (name.length > 214) {
    warnings.push("name can no longer contain more than 214 characters")
  }

  // mIxeD CaSe nAMEs
  if (name.toLowerCase() !== name) {
    warnings.push("name can no longer contain capital letters")
  }
github davidhealey / waistline / node_modules / npm / node_modules / validate-npm-package-name / index.js View on Github external
if (name.trim() !== name) {
    errors.push("name cannot contain leading or trailing spaces")
  }

  // No funny business
  blacklist.forEach(function(blacklistedName){
    if (name.toLowerCase() === blacklistedName) {
      errors.push(blacklistedName + " is a blacklisted name")
    }
  })

  // Generate warnings for stuff that used to be allowed

  // core module names like http, events, util, etc
  builtins.forEach(function(builtin){
    if (name.toLowerCase() === builtin) {
      warnings.push(builtin + " is a core module name")
    }
  })

  // really-long-package-names-------------------------------such--length-----many---wow
  // the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch.
  if (name.length > 214) {
    warnings.push("name can no longer contain more than 214 characters")
  }

  // mIxeD CaSe nAMEs
  if (name.toLowerCase() !== name) {
    warnings.push("name can no longer contain capital letters")
  }
github graalvm / graaljs / deps / npm / node_modules / validate-npm-package-name / index.js View on Github external
if (name.trim() !== name) {
    errors.push('name cannot contain leading or trailing spaces')
  }

  // No funny business
  blacklist.forEach(function (blacklistedName) {
    if (name.toLowerCase() === blacklistedName) {
      errors.push(blacklistedName + ' is a blacklisted name')
    }
  })

  // Generate warnings for stuff that used to be allowed

  // core module names like http, events, util, etc
  builtins.forEach(function (builtin) {
    if (name.toLowerCase() === builtin) {
      warnings.push(builtin + ' is a core module name')
    }
  })

  // really-long-package-names-------------------------------such--length-----many---wow
  // the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch.
  if (name.length > 214) {
    warnings.push('name can no longer contain more than 214 characters')
  }

  // mIxeD CaSe nAMEs
  if (name.toLowerCase() !== name) {
    warnings.push('name can no longer contain capital letters')
  }

builtins

List of node.js builtin modules

MIT
Latest version published 7 months ago

Package Health Score

73 / 100
Full package analysis