How to use read-package-json-fast - 1 common examples

To help you get started, we’ve selected a few read-package-json-fast 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 / arborist / lib / node.js View on Github external
resolved,
      integrity,
      // allow setting name explicitly when we haven't set a path yet
      name,
      children,
      fsChildren,
      linksIn,
      hasShrinkwrap,
      extraneous = true,
      dev = true,
      optional = true,
      devOptional = true,
    } = options

    this.errors = error ? [error] : []
    const pkg = normalize(options.pkg || {})

    this.name = name ||
      nameFromFolder(path || pkg.name || realpath) ||
      pkg.name

    if (!this.name)
      throw new TypeError('could not detect node name from path or package')

    // should be equal if not a link
    this.path = path
    this.realpath = !this.isLink ? this.path : realpath

    this.resolved = resolved || null
    if (!this.resolved) {
      // note: this *only* works for non-file: deps, so we avoid even
      // trying here.

read-package-json-fast

Like read-package-json, but faster

ISC
Latest version published 2 years ago

Package Health Score

82 / 100
Full package analysis

Popular read-package-json-fast functions

Similar packages