
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
simple-pandoc
Advanced tools
A thin and simple pandoc wrapper function
simple-pandoc
provides probably the thinest and simplest Node.js binding for
pandoc. It just wraps the pandoc
command into JavaScript APIs.
It focuses on a very simple use case, and may not provide complicated functionalities. If they are needed, please check out other libraries on npm.
simple-pandoc
doesn't provide pandoc
itself. Please ensure that pandoc
is installed and executable. To install pandoc, please refer to the
Installing section in the pandoc
documentation.
To install simple-pandoc
, use npm.
$ npm install simple-pandoc
const pandoc = require('simple-pandoc');
pandoc(from, to, ...opts)
from
: String
a format specified in the pandoc documentationto
: String
a format specified in the pandoc documentationopts
: ...String
options specified in the pandoc documentationFunction
a converter functionExample:
const htmlToMarkdown = pandoc('html', 'markdown', '--no-highlight', '--key=value', ...);
converter(content)
content
: String|Buffer
content in the from
format to be convertedPromise<Buffer>
promised content in the to
formatExample:
const htmlToMarkdown = pandoc('html', 'markdown');
htmlToMarkdown(fs.readFileSync('index.html'))
.then(md => {
console.log(md.toString());
});
Even better with async/await:
const htmlToMarkdown = pandoc('html', 'markdown');
async function convert() {
const html = fs.readFileSync('index.html');
const md = await htmlToMarkdown(html);
console.log(md.toString());
}
convert();
converter.stream(readStream)
readStream
: Readable
a stream conveying content in the from
format
return: Readable
a stream conveying converted content in the to
format
Example:
const htmlToMarkdown = pandoc('html', 'markdown');
const inputStream = fs.createReadStream('index.html');
const outputStream = fs.createWriteStream('index.md');
htmlToMarkdown.stream(inputStream).pipe(outputStream);
MIT © Jun
FAQs
A thin and simple pandoc wrapper function
The npm package simple-pandoc receives a total of 117 weekly downloads. As such, simple-pandoc popularity was classified as not popular.
We found that simple-pandoc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.