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

@raulingg/md-links

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@raulingg/md-links - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

53

dist/cli.js
#!/usr/bin/env node
"use strict";
var _yargs = _interopRequireDefault(require("yargs"));
var _minimist = _interopRequireDefault(require("minimist"));
var _mdLinks = _interopRequireDefault(require("./mdLinks"));
var _package = _interopRequireDefault(require("../package"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const start = new Date();
const args = _yargs.default.argv;
const error = err => {
console.error(err.errorInfo || err);
console.error(`Try "${_package.default.name} --help" to see available commands and options`);
process.exit(1);
};
const help = () => `
Usage: ${_package.default.name} path [options]
path:
/path/to/dir absolute path to a folder
/path/to/file.md absolute path to a file
./relative/file.md relative path to a file
relative/dir relative path to a folder
Options:
-val, --validate Verify if links are broken
-s, --stats Show stats about markdown links found (total, unique) and
when validate option is provided along it's also gonna show number broken links
-h, --help Show help
-v, --version Show version
`;
const {
_: args,
...opts
} = (0, _minimist.default)(process.argv.slice(2));
if (opts.v || opts.version) {
console.info(_package.default.version);
process.exit(0);
}
if (opts.h || opts.help) {
console.info(help());
process.exit(0);
}
const options = {
validate: Boolean(args.validate),
stats: Boolean(args.stats)
validate: Boolean(opts.validate || opts.val),
stats: Boolean(opts.stats || opts.s)
};
(0, _mdLinks.default)(args._[0], options).then(mdLink => {
(0, _mdLinks.default)(args[0], options).then(mdLink => {
if (options.stats) {

@@ -28,2 +68,3 @@ const stats = mdLink.stats();

console.info('Execution time: %dms', new Date() - start);
});
process.exit(0);
}).catch(error);

9

package.json
{
"name": "@raulingg/md-links",
"version": "0.3.0",
"version": "0.4.0",
"description": "This library allows you to find links within markdown files",

@@ -34,7 +34,8 @@ "author": "Raul Quispe <relaxedchild@gmail.com>",

"fetch-mock": "^7.3.3",
"jest": "^24.8.0"
"jest": "^24.8.0",
"np": "^5.0.3"
},
"dependencies": {
"node-fetch": "^2.6.0",
"yargs": "^13.2.4"
"minimist": "^1.2.0",
"node-fetch": "^2.6.0"
},

@@ -41,0 +42,0 @@ "engines": {

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