Home

Awesome

V8-CFFI

Build Status Coverage Status pypi licence

Embed the V8 Javascript engine into Python.

Note: The initial purpose of this library is to render React components server side.

Compatibility

Note: Linux-x64 is the only (officially) supported platform. To build the binaries for other platforms, the ./dev steps must be adapted (probably to vagrant instead of docker) accordingly. PRs are welcome.

Usage

from v8cffi import shortcuts
shortcuts.set_up()

ctx = shortcuts.get_context()
ctx.load_libs(['./foo_bundled.js'])
ctx.run_script('foo.render("hola mundo");')
# "hola mundo"

Read the docs.

Notes

Resources

Devs

Devs

Benchmarks

This will run some silly benchmarks. It runs about ~110k ops/s on a 1.8GHz CPU.

$ make benchmarks

License

MIT