
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
parser-cache
Advanced tools
Cache and load parsers, similiar to consolidate.js engines.
npm i parser-cache --save
var parsers = require('parser-cache');
options {Object}: Default options to use.var Parsers = require('parser-cache');
var parsers = new Parsers();
Register the given parser callback fn as ext. If ext is not given, the parser fn will be pushed into the default parser stack.
ext {String}fn {Function|Object}: or optionsreturns {Object} parsers: to enable chaining.// Push the parser into the default stack
parsers.register(require('parser-front-matter'));
// Or push the parser into the `foo` stack
parsers.register('foo', require('parser-front-matter'));
Run a stack of async parsers for the given file. If file is an object with an ext property, then ext is used to get the parser stack. If ext doesn't have a stack, the default noop parser will be used.
file {Object|String}: Either a string or an object.stack {Array}: Optionally pass an array of functions to use as parsers.options {Object}returns {Object}: Normalize file object.var str = fs.readFileSync('some-file.md', 'utf8');
parsers.parse({ext: '.md', content: str}, function (err, file) {
console.log(file);
});
Or, explicitly pass an array of parser functions as a section argument.
parsers.parse(file, [a, b, c], function (err, file) {
console.log(file);
});
Run a stack of sync parsers for the given file. If file is an object with an ext property, then ext is used to get the parser stack. If ext doesn't have a stack, the default noop parser will be used.
file {Object|String}: Either a string or an object.stack {Array}: Optionally pass an array of functions to use as parsers.options {Object}returns {Object}: Normalize file object.var str = fs.readFileSync('some-file.md', 'utf8');
parsers.parseSync({ext: '.md', content: str});
Or, explicitly pass an array of parser functions as a section argument.
parsers.parseSync(file, [a, b, c]);
Run a stack of stream parsers for input files.
stack {Array}: Optionally pass an array of functions to use as parsers.options {Object}returns {Stream}: Stream pipeline used to parse files in a stream.gulp.src('path/to/files/*.md')
.pipe(parsers.parseStream({ext: '.md'}))
.pipe(gulp.dest('dist'));
Or, explicitly pass an array of parser functions as a section argument.
gulp.src('path/to/files/*.md')
.pipe(parsers.parseStream([a, b, c], {ext: '.md'}))
.pipe(gulp.dest('dist'));
Return the parser stored by ext. If no ext is passed, the entire parsers is returned.
ext {String}: The parser to get.returns {Object}: The specified parser.parser.get('md')
// => { parse[function]}
Remove the parser stack for the given ext, or if no value is specified the entire parsers object is clear.
ext {String}: The stack to remove.Example:
parsers.clear()
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on October 14, 2014.
FAQs
Cache and load parsers, similiar to consolidate.js engines.
The npm package parser-cache receives a total of 105 weekly downloads. As such, parser-cache popularity was classified as not popular.
We found that parser-cache 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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.