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

@phiresky/pandoc-filter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phiresky/pandoc-filter

Pandoc filtering for Node.js

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

About

Node.js port of the Python pandocfilters for filtering with Pandoc

Install

npm install -g pandoc-filter

Example

#!/usr/bin/env node

// Pandoc filter to convert all text to uppercase

var pandoc = require('pandoc-filter');
var Str = pandoc.Str;

function action(type,value,format,meta) {
	if (type === 'Str') return Str(value.toUpperCase());
}

pandoc.stdio(action);

Async using native promise

#!/usr/bin/env node
'use strict';

var pandoc = require('../../../index');
var rp = require('request-promise-native');
var Str = pandoc.Str;

async function action(type,value,format,meta) {
	if (type === 'Str') return rp({
		uri: value,
		json: true
	}).then(function (data) {
		return Str(data.places[0]["post code"]);
	})
}

pandoc.stdioAsync(action);

Compatibility Notes

Required node >=v7.6 for async/await/promise support.

v0.1.6 is required for pandoc versions after 1.17.2 to support the new JSON format. See this issue for details.

Credits

Thanks to John MacFarlane for Pandoc.

License

MIT

Keywords

FAQs

Package last updated on 13 Dec 2019

Did you know?

Socket

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.

Install

Related posts

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