You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use your favorite technology to load node_modules/dist/rdf-canonize.min.js.
HTML
Various NPM proxy CDN sites offer direct access to NPM files.
Examples
constdataset={// ...};// canonize a data set with a particular algorithm using callbackcanonize.canonize(dataset,{algorithm: 'URDNA2015'},function(err,canonical){// ...});// canonize a data set with a particular algorithm using async/awaitconstcanonical=canonize.canonize(dataset,{algorithm: 'URDNA2015'});
This library includes a sample testing utility which may be used to verify
that changes to the processor maintain the correct output.
The test suite is included in an external repository:
https://github.com/json-ld/normalization
This should be a sibling directory of the rdf-canonize directory or in a
test-suites dir. To clone shallow copies into the test-suites dir you can
use the following:
npm run fetch-test-suite
Node.js tests can be run with a simple command:
npm test
If you installed the test suites elsewhere, or wish to run other tests, use
the TEST_DIR environment var:
TEST_DIR="/tmp/tests" npm test
To generate earl reports:
# generate the earl report for node.js
EARL=earl-node.jsonld npm test