From 34d03e38e8571f3ca882817351bdb8bae87fb12f Mon Sep 17 00:00:00 2001 From: Ilyar <761285+ilyar@users.noreply.github.com> Date: Mon, 10 Apr 2023 07:54:29 +0200 Subject: [PATCH] fix: make import for `fromBoc` --- README.md | 11 +++++++++++ src/index.ts | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f05f491..cc6a9fb 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Published on npm](https://img.shields.io/npm/v/tvm-disassembler.svg?logo=npm)](https://www.npmjs.com/package/tvm-disassembler) ## Usage + ```typescript let client = new TonClient({ endpoint: 'https://scalable-api.tonwhales.com/jsonRPC' @@ -15,3 +16,13 @@ let codeCell = Cell.fromBoc(state.code)[0]; let source = await fromCode(codeCell); ``` + +or + +```typescript +import { fromBoc } from 'tvm-disassembler' +import * as fs from 'fs' +const boc = fs.readFileSync('path.boc') +const code = fromBoc(boc) +console.log(code) +``` diff --git a/src/index.ts b/src/index.ts index 9b2b7b8..5f74d2d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,8 @@ -import { decompile, fromCode, setCodepage } from './disassembler' +import { decompile, fromCode, setCodepage, fromBoc } from './disassembler' export { decompile, fromCode, setCodepage, -} \ No newline at end of file + fromBoc, +}