Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaubee/ts-bigint-transform-jsbi
https://github.com/gaubee/ts-bigint-transform-jsbi
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gaubee/ts-bigint-transform-jsbi
- Owner: Gaubee
- Created: 2019-08-12T09:38:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T10:20:52.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T21:20:37.790Z (7 months ago)
- Language: TypeScript
- Size: 394 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ts-bigint-transform-jsbi
## How To Use
```ts
import { CompileFactory } from "ts-bigint-transform-jsbi";
import * as ts from "typescript";const compile = CompileFactory({
IMPORT_HEADER: `const JSBI = require('jsbi');\nconst BigInt = JSBI.BigInt;\n`
});
compile(process.argv.slice(2), {
noEmitOnError: true,
noImplicitAny: true,
target: ts.ScriptTarget.ESNext,
module: ts.ModuleKind.CommonJS,
outDir: "./build"
});
```## Custom Compile
you can get an `transformer` to transform code when emit program.
and get the transform count in every source file.```ts
import { TransformerFactory } from "ts-bigint-transform-jsbi";
const { transformer, bigintTransformCount } = TransformerFactory(
(program).getTypeChecker(),
{ JSBI_GLOBAL_SYMBOL_NAME: "JSBI" }
);const c: WeakMap = bigintTransformCount;
const t: ts.TransformerFactory = transformer;
```