File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,21 @@ and [binary](https://github.com/substack/node-binary).
3131
3232## Quick Start
3333
34- 1 . Create an empty Parser object with ` new Parser() ` or ` Parser.start() ` .
35- 2 . Chain methods to build your desired parser. (See
36- [ API] ( https://github.com/keichi/binary-parser#api ) for detailed document of
37- each method)
34+ 1 . Create an empty ` Parser ` object with ` new Parser() ` or ` Parser.start() ` .
35+ 2 . Chain methods to build your desired parser. (See [ API] ( #api ) for detailed
36+ documentation of each method)
38373 . Call ` Parser.prototype.parse ` with a ` Buffer ` /` Uint8Array ` object passed as
39- an argument.
38+ its only argument.
40394 . The parsed result will be returned as an object.
40+ - If parsing failed, an exception will be thrown.
4141
4242``` javascript
4343// Module import
4444const Parser = require (" binary-parser" ).Parser ;
4545
46+ // Alternative way to import the module
47+ // import { Parser } from "binary-parser";
48+
4649// Build an IP packet header Parser
4750const ipHeader = new Parser ()
4851 .endianness (" big" )
You can’t perform that action at this time.
0 commit comments