Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openkraken/node-qjsc
Node.js addon for the QuickJS compiler
https://github.com/openkraken/node-qjsc
compiler quickjs
Last synced: about 2 hours ago
JSON representation
Node.js addon for the QuickJS compiler
- Host: GitHub
- URL: https://github.com/openkraken/node-qjsc
- Owner: openkraken
- License: apache-2.0
- Created: 2021-09-09T09:07:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-29T01:54:22.000Z (about 2 years ago)
- Last Synced: 2024-11-03T17:43:18.653Z (5 days ago)
- Topics: compiler, quickjs
- Language: C
- Homepage:
- Size: 4.48 MB
- Stars: 25
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-qjsc
> Node.js addon for the [QuickJS](https://github.com/bellard/quickjs) compiler.Current supported version:
+ 20210327## Install
```
npm install qjsc --save
```## Usage
```javascript
const Qjsc = require('qjsc');
const qjsc = new Qjsc();// Dump bytecode from javascript source;
qjsc.compile('function hello() { return 1 + 1};'); //// Use specified quickjs version
qjsc = new Qjsc({version: '20210327'});// Get all supported versions.
qjsc.getSupportedVersions();
```## Contribute
**Generate compile_commands.json**
```
node-gyp configure -- -f gyp.generator.compile_commands_json.py
```**Prebuild linux binary**
1. Install docker
2. Build local image with Dockerfile
```
docker build -t qjsc .
```
3. Enter into images
```
docker run --rm -it -v $(pwd):/project qjsc
```
4. Set up env in docker container
```
cd project
scl enable rh-nodejs12 bash
scl enable devtoolset-7 bash
```
5. Build your binary
```
npm install
npm run prebuild
```