Comparing version 1.0.1 to 2.0.0
{ | ||
"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(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
24745
689
123