A lot of packages have one or more executable files that they’d like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the “npm” executable.) To use this, supply a bin field in your package.json which is a map of command name to local file name. On install, npm will symlink that file into prefix/bin for global installs, or ./node_modules/.bin/ for local installs. [https://docs.npmjs.com/files/package.json#bin](https://docs.npmjs.com/files/package.json#bin) |
||
|---|---|---|
| examples | ||
| lib | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| index.js | ||
| package-lock.json | ||
| package.json | ||
README.md
Medium to markdown
This module lets you take a medium post and convert it to markdown.
Command Line Usage
Setup:
- Install npm if not already installed
- Clone the repo
- run
npm installinside the repo
Outputting to command line:
npm run convert https://medium.com/@almenon214/keeping-yourself-motivated-as-a-coder-a16a6fcf49c7
Replace the link with the article you want to convert.
Outputting to file:
npm run convert https://medium.com/@almenon214/keeping-yourself-motivated-as-a-coder-a16a6fcf49c7 > exampleOutput.md
Replace the link with the article you want to convert.
What does the output look like?
See examples/exampleOutput.md for an example of what https://medium.com/@almenon214/keeping-yourself-motivated-as-a-coder-a16a6fcf49c7 looks like when converted to markdown.
API Usage
Currently, the module supports getting the markdown from a medium post by URL.
const mediumToMarkdown = require('medium-to-markdown');
mediumToMarkdown.convertFromUrl('<medium post url>')
.then(function (markdown) {
console.log(markdown); //=> Markdown content of medium post
});