2.0.2 • Published 4 years ago
snyk-try-require v2.0.2
Snyk's (try) require
This package tries to load and parse a package.json file. This does not load the package into memory (as per require).
What snyk-try-require does:
- Returns a promise
- Does not throw if the
package.jsoncan't be found, but fulfills withnull - Uses
debugmodule under thesnyk:resolve:try-requirekey - Uses lru-cache for caching for 100 objects for 1 hour
- Adds
dependenciesanddevDependenciesif they're missing - Adds
__filenamecontaining the full original path to the package - If a Snyk policy is present, will add the path of the policy to the
snykproperty - If the package uses
npm-shrinkwrap.jsonwill include ashrinkwrapboolean property - Returns the
leadingandtrailingwhitespace of the originalpackage.jsonfile as aleadingandtrailingproperty respectively