Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snyk-try-require

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-try-require - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

.nyc_output/2420.json

9

lib/try-require.js

@@ -25,3 +25,8 @@ module.exports = tryRequire;

return fs.readFile(filename, 'utf8')
.then(JSON.parse)
.then(function (pkgStr) {
var pkg = JSON.parse(pkgStr);
pkg.leading = pkgStr.match(/^(\s*){/)[1];
pkg.trailing = pkgStr.match(/}(\s*)$/)[1];
return pkg;
})
.catch(function (e) {

@@ -91,2 +96,2 @@ debug('tryRequire silently failing on %s', e.message);

.catch(console.log);
}
}

@@ -38,3 +38,3 @@ {

},
"version": "1.1.1"
"version": "1.2.0"
}

@@ -14,2 +14,3 @@ # Snyk's (try) require

- If a Snyk policy is present, will add the path of the policy to the `snyk` property
- If the package uses `npm-shrinkwrap.json` will include a `shrinkwrap` boolean property
- If the package uses `npm-shrinkwrap.json` will include a `shrinkwrap` boolean property
- Returns the `leading` and `trailing` whitespace of the original `package.json` file as a `leading` and `trailing` property respectively
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc