Skip to content

An implementation of the google/hrx spec in JS for NodeJS.

License

Notifications You must be signed in to change notification settings

rebeccajae/hrx.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HRX.js

An implementation of the HRX spec in JavaScript for NodeJS.

Compatibility Notes

This uses negative lookbehinds in regular expressions so you have to use a relatively recent version of NodeJS.

Usage

The only method exposed by hrx.js is parse_hrx at top-level.

const parse_hrx = require('./hrx.js');

parse_hrx(contents)

This takes in a string containing the contents of an appropriate file, and returns an array.

const [hrx_parsed, errs] = parse_hrx(contents);

The errs entry contains an array of errors encountered while parsing.

The hrx_parsed entry is a JSON object that is appropriate for consumption with MemFS.

Notes

The difference between this version and the Python version is that the array of errors is just a set of strings that describe the fault. You should keep in mind to check the length of the error result.

About

An implementation of the google/hrx spec in JS for NodeJS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published