diff --git a/examples/cjs/index.js b/examples/cjs/index.js index 03f08df4..fcb8871d 100644 --- a/examples/cjs/index.js +++ b/examples/cjs/index.js @@ -1,4 +1,4 @@ -const borsh = require('borsh-js'); +const borsh = require('borsh'); const encodedU16 = borsh.serialize('u16', 2); const decodedU16 = borsh.deserialize('u16', encodedU16); @@ -7,3 +7,7 @@ console.log(decodedU16); const encodedStr = borsh.serialize('string', 'testing'); const decodedStr = borsh.deserialize('string', encodedStr); console.log(decodedStr); + +const encodedU64 = borsh.serialize('u64', '100000000000000000'); +const decodedU64 = borsh.deserialize('u64', encodedU64); +console.log(decodedU64); \ No newline at end of file diff --git a/examples/cjs/package.json b/examples/cjs/package.json index d9f4f22b..4e7154c8 100644 --- a/examples/cjs/package.json +++ b/examples/cjs/package.json @@ -4,7 +4,10 @@ "version": "2.0.0", "description": "", "main": "index.js", + "scripts": { + "start": "node index.js" + }, "dependencies": { - "borsh-js": "file:../../" + "borsh": "^2" } } \ No newline at end of file diff --git a/examples/esm/index.js b/examples/esm/index.js index ab745dd7..62a57fdd 100644 --- a/examples/esm/index.js +++ b/examples/esm/index.js @@ -1,9 +1,13 @@ -import * as borsh from 'borsh-js'; +import * as borsh from 'borsh'; const encodedU16 = borsh.serialize('u16', 2); const decodedU16 = borsh.deserialize('u16', encodedU16); console.log(decodedU16); -const encodedStr = borsh.serialize('u64', '100000000000000000'); -const decodedStr = borsh.deserialize('u64', encodedStr); -console.log(decodedStr); \ No newline at end of file +const encodedStr = borsh.serialize('string', 'testing'); +const decodedStr = borsh.deserialize('string', encodedStr); +console.log(decodedStr); + +const encodedU64 = borsh.serialize('u64', '100000000000000000'); +const decodedU64 = borsh.deserialize('u64', encodedU64); +console.log(decodedU64); \ No newline at end of file diff --git a/examples/esm/package.json b/examples/esm/package.json index 6b51ef43..ea067a66 100644 --- a/examples/esm/package.json +++ b/examples/esm/package.json @@ -5,7 +5,10 @@ "description": "", "type": "module", "main": "index.js", + "scripts": { + "start": "node index.js" + }, "dependencies": { - "borsh-js": "file:../../" + "borsh": "^2" } } \ No newline at end of file