How to use fastparse - 1 common examples

To help you get started, we’ve selected a few fastparse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github teux / ng-cache-loader / lib / urlParser.js View on Github external
module.exports = function(src) {
    var urls = Parser.parse('root', src, {urls: []}).urls;
    var i = urls.length;
    var result = [];

    while (i--) {
        result.push(JSON.stringify(src.substr(urls[i].idx + urls[i].path.length)));
        result.push(' + require("' + urls[i].path + '") + ');
        src = src.substr(0, urls[i].idx);
    }
    result.push(JSON.stringify(src));
    result.reverse();
    return result.join('');
};

fastparse

A very simple and stupid parser, based on a statemachine and regular expressions.

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis

Popular fastparse functions