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

mdopt

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdopt - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

2

package.json
{
"name": "mdopt",
"version": "1.0.1+querie.cc",
"version": "2.0.0+querie.cc",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "typings": "index.d.ts",

@@ -22,8 +22,18 @@ # mdopt

const argv = mdopt('./spec.md')(process.argv.slice(2));
const { readFileSync } = require('fs');
const md = readFileSync('path.md', {
encoding: 'utf8'
});
const argv = process.argv.slice(2)
const argv = mdopt(argv, md);
console.log(argv);
```
`argv` is a variable that holds a [minimist][mi] object.
`argv` is a variable that holds a [minimist][mi] object that has
been populated (aliases, defaults) according to the provided markdown
file.

@@ -30,0 +40,0 @@ [mi]: https://www.npmjs.com/package/minimist

@@ -1,8 +0,7 @@

const { readFileSync } = require("fs");
const parse = require("./optparser");
module.exports = function mdopt(pathToMarkdown, nodeArgs) {
const md = readFileSync(pathToMarkdown, { encoding: "utf8" });
module.exports = function mdopt(argv, md) {
return parse(argv, md);
};
return parse(nodeArgs, md);
};
module.exports.default = module.exports;
const path = require("path");
const { readFileSync } = require("fs");
const tap = require("tap");

@@ -6,7 +7,8 @@ const mdopt = require("../src/index");

const markdownPath = path.join(__dirname, "files", "everything.md");
const md = readFileSync(markdownPath, { encoding: "utf8" });
tap.test("mdopt", t => {
mdopt(markdownPath, []);
mdopt([], md);
t.end();
});
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