https://github.com/localvoid/hoistr
TypeScript transformer for hoisting expressions to the module scope
https://github.com/localvoid/hoistr
Last synced: about 1 year ago
JSON representation
TypeScript transformer for hoisting expressions to the module scope
- Host: GitHub
- URL: https://github.com/localvoid/hoistr
- Owner: localvoid
- License: mit
- Created: 2020-01-15T06:51:34.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T21:42:07.000Z (over 4 years ago)
- Last Synced: 2025-03-18T15:11:53.806Z (about 1 year ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
TypeScript transformer for hoisting expressions to the module scope.
```sh
$ npm i --save-dev hoistr ts-hoistr
```
Input:
```ts
import { hoist } from "hoistr";
function A() {
return hoist({ value: 123 });
}
```
Output:
```js
const ___hoisted_1 = { value: 123 };
function A() {
return ___hoisted_1;
}
```