Skip to content

Fishrock123/nucleus-chakra

Repository files navigation

nucleus-chakra

NOTES:

  • This does not build correctly yet!
  • All info below may or may not be correct as it is for the rust-duktape version.
  • The master branch will likely be force-pushed.

This is an implementation of the nucleus-js design spec written in Rust and using the duktape JavaScript engine.

The rustc compiler and the cargo package manager are necessary in order to build this project. The best way to install Rust on Unix is probably to use rustup.rs.

Note: This repo also uses git submodules to manage it's dependencies. As such, cloning this repo must be done with git clone --depth=1 ....

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Building

make

or

cargo build

Examples

Single-file:

// hello.js
print('hello world')
./target/debug/nucleus --no-bundle hello.js
> hello world

Bundle: (main.js)

// bundle/main.js
print('hello world')
./target/debug/nucleus bundle -o hello-app
./hello-app
> hello world

Tests

Manual tests:

make test

Currently, each test should have output that looks similar to this. In the future, it will use the design repo's automated tests.

Hello World!
nucleus:  [object Object]
cmd:  target/debug/nucleus
rawArgs:  target/debug/nucleus,--no-bundle,test.js,--,0,5,10
rawArgs[0]:  target/debug/nucleus
rawArgs[1]:  --no-bundle
rawArgs[2]:  test.js
rawArgs[3]:  --
rawArgs[4]:  0
rawArgs[5]:  5
rawArgs[6]:  10
engine:  duktape
versions:  [object Object]
versions.duktape:  v1.5.0
envkeys:  SHELL, <... etc>
envkeys(true): SHELL, <... etc>
readfile('test-error.js')  print('hi')

nucleus.exit('aaaa')

print(":/")

throw new Error('error!!')

print('noooo')

exit:  function () {"native"}

License

nucleus-chakra is licensed under the Apache 2.0 License.

About

nucleus-js built on ChakraCore

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published