New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

duh-core

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duh-core - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

22

lib/read-duh.js
'use strict';
const fs = require('fs-extra');
const path = require('path');

@@ -8,14 +7,17 @@ const JSON5 = require('json5');

module.exports = argv => new Promise((resolve) => {
module.exports = argv => new Promise(resolve => {
if (argv.verbose) console.log('reading spec');
// read duh.json
const folderName = path.basename(process.cwd());
const fileName = argv.filename || folderName + '.json5';
fs.readFile(fileName, 'utf-8')
.then(duhRaw => {
const duh = JSON5.parse(duhRaw);
// json dereference
jsonRefs.resolveRefs(duh)
.then(value => resolve(value.resolved));
});
// json dereference
jsonRefs.resolveRefs({$ref: fileName}, {
loaderOptions: {
processContent: function (res, cb) {
let ml = JSON5.parse(res.text);
cb(undefined, ml);
}
}
}).then(res => {
resolve(res.resolved);
});
});
{
"name": "duh-core",
"version": "0.7.0",
"version": "0.8.0",
"description": "DUH core",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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