Open-source project
svaarala/duktape avatar
svaarala/duktape

Duktape: three files, one C API, and two divergent branches

Duktape - embeddable Javascript engine with a focus on portability and compact footprint

6,217 stars541 forksJavaScriptMIT

At a glance

What is it?
Duktape is an embeddable JavaScript engine you vendor as duktape.c, duktape.h and duk_config.h. Its language coverage stops at partial ES2015, its master branch is mid-way through incompatible 3.x changes, and the repository you read is the engine internals rather than the library you ship.
Who is it for?
Duktape fits an embedder who wants a small, vendored interpreter with a three file integration and no runtime dependency, and who is willing to read the Post-ES5 feature status page before committing to a language feature. It does not fit a team that needs full ES2015 coverage, published benchmark numbers, or a stream of tagged releases after v2.7.0.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 72 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • svaarala/duktape6,217 ★ · +6
Star history
Repository2026-09-232026-11-15
svaarala/duktape6.2k6.2k

6 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Three files and a C API are the whole integration surface

Integration with Duktape is three files and one API. The project describes itself as an embeddable JavaScript engine with a focus on portability and compact footprint, and the surface matches that claim: add duktape.c, duktape.h and duk_config.h to your build, then use the Duktape API to call ECMAScript functions from C code and vice versa. There is no runtime to install and no interpreter binary to deploy. The distributable's src/ directory holds duk_config.h plus the amalgamated sources for the default configuration, so a host can vendor one C file and a header pair and reach JavaScript from there. Memory management combines reference counting with a mark-and-sweep collector and finalization, which matters for hosts that need native handles torn down at a predictable point. Minimal platform dependencies is on the feature list, so porting to a new target means writing platform glue rather than rewriting an interpreter. Beyond the specification, coroutines ship as a custom feature, and property virtualization is built on a subset of the ES2015 Proxy object, which lets a host intercept property access without a complete Proxy implementation.

Language coverage stops short of full ES2015

The engine is E5/E5.1 with holes in the newer editions. Duktape is described as ECMAScript E5/E5.1 compliant, with some semantics updated from ES2015+, and it claims partial rather than full support for ECMAScript 2015 and 2016. Two bindings are named outright: ES2015 TypedArray and Node.js Buffer. Coverage questions are delegated to two external references, a Post-ES5 feature status page on the project wiki and the kangax compat table, instead of being settled in the project text itself. Beyond the language, the built-in list includes a debugger, a regular expression engine, Unicode support, and bytecode dump and load for caching compiled functions. The distributable additionally carries an optional logging framework, CommonJS-based module loading implementations and CBOR bindings. If your code needs a specific newer feature, check that feature status page before you design around it.

Master tracks 3.x while 2.x lives on v2-maintenance

The default branch is not the branch to build from. The first warning on the project's own page states that the master branch is undergoing incompatible changes for Duktape 3.x, and that Duktape 2.x is followed on the v2-maintenance branch. The branch policy section adds the operational detail: master is used for active development, pull requests are tested before merging, and master may still be broken from time to time. When work on a new major release starts, master also receives API incompatible changes without warning. The same policy tells you that you should generally not depend on master for building your project, and to use a release tag such as v2.4.0 or a maintenance branch such as v2.4-maintenance or v2-maintenance instead. It also warns that pull requests and their related branches are frequently rebased, so forking off one wastes effort while it is open. Released artifacts match release tags rather than any branch, which makes a tag-pinned build the reproducible option here.

This repository holds the engine internals, not the library you ship

The repository you are reading is the wrong place to start as an embedder. The project states that this repository is intended for Duktape developers only and that it contains Duktape internals: test cases, internal documentation, and the sources for the duktape.org web site. Anyone embedding the engine is pointed at the packaged source distributables on duktape.org/download.html, with the end user downloads also published in the svaarala/duktape-releases repository as both binaries and unpacked form as git tags. The root package.json confirms the split: it is named @duktape/duktape-repo, its own description reads Dummy package for Duktape repository, it is private, and its version is the placeholder 2.99.99 rather than a shipped engine version. Its scripts object is empty, and the only engine constraint is node >=14, which exists for the build tooling rather than for the library. The examples/ directory shows what host side integration looks like, with alloc-hybrid, alloc-logging, alloc-torture, cmdline, codepage-conv, coffee, cpp-exceptions, debug-trans-dvalue, debug-trans-socket, dummy-date-provider, eval, eventloop, guide, hello, jxpretty and sandbox.

configure.py regenerates the amalgamation instead of patching duk_config.h

Configuration is regenerated, not hand edited. When the default configuration does not fit, tools/configure.py writes a header and amalgamated sources for a customized configuration into a directory you choose. The worked example in the project enables fastint support on Linux, and the output directory ends up holding the same three files an embedder needs.

code
$ tar xvfJ duktape-2.0.0.tar.xz
$ cd duktape-2.0.0
$ rm -rf src-custom
$ python tools/configure.py \
      --source-directory src-input \
      --output-directory src-custom \
      --config-metadata config \
      -DDUK_USE_FASTINT

# src-custom/ will now contain: duktape.c, duktape.h, duk_config.h.

The flags are explicit about their jobs: --source-directory selects the input tree, --output-directory receives the generated amalgamation, --config-metadata points at the config metadata, and each -DDUK_... argument turns on one build option. Generating sources instead of patching a header keeps a configuration change reproducible and reviewable in version control, and the Configuring page on the project wiki is where the option list lives. Two details in the example are easy to miss. It removes an existing src-custom directory before generating, so a stale directory is never silently merged, and the version in the archive name, 2.0.0 in this case, is only the tarball you happened to unpack.

Three ways to get it, each with a stated cost

There are three paths to a working engine, and the project is explicit about the price of each. The cheapest is the packaged source distributable from duktape.org, which requires no repository clone. The next is a dependency manager. Duktape is installable through vcpkg, and that port is kept up to date by Microsoft team members and community contributors, with an issue or pull request invited on the vcpkg repository when the version falls behind.

code
$ git clone https://github.com/Microsoft/vcpkg.git
$ cd vcpkg
$ ./bootstrap-vcpkg.sh
$ ./vcpkg integrate install
$ vcpkg install duktape

The third path is building the source distributable from a clone, and this is where the toolchain requirements stop being implicit. Every platform needs Python 2 and the Python YAML binding, and Node.js >= 16.x as well. On Linux the project suggests installing from packages or using pip.

code
# Linux; can often install from packages or using 'pip'
# Install Node.js >= 16.x
$ sudo apt-get install python python-yaml
$ python util/dist.py

# macOS
# Install Python 2.7.x
# Install Node.js >= 16.x
$ pip install PyYAML
$ python util/dist.py

The generated source distributable lands in dist/. Note the version mismatch that this path exposes: a Python 2 based build toolchain, a Node 16 or newer requirement, and an engine whose latest tag is v2.7.0.

The root Makefile refuses to be your build system

The Makefile at the repository root scopes itself firmly. It is intended only for internal Duktape development on Linux or other UNIX like systems, it warns in capital letters that you should not compile Duktape with this Makefile in your project, and it says that when creating actual distributables you should always use a clean checkout. End user projects get more platform neutral example Makefiles inside the source distributable, though the project is equally direct that a real end user should just use their own build system. Cygwin is described as working in a very limited fashion, where you can run make dist/source if you have enough software installed. Parallel builds work with -jN except for the clean target, so a clean build is make clean followed by make -j4. External projects are downloaded on the fly, cloned shallowly with --depth 1 whenever possible, cached in deps/, and removed only by make cleanall rather than make clean. Docker is offered to reduce host dependencies rather than to widen platform support, and the images are Linux x86-64 only.

code
# Build Docker images.  This takes a long time.
$ make docker-images

# Equivalent of 'make dist-source', but runs inside a container.
$ make docker-dist-source-wd

# Run a shell with /work/duktape containing a disposable master snapshot.
$ make docker-shell-master

# Run a shell with /work/duktape mounted from current directory.
$ make docker-shell-wdmount

docker-shell-master hands you a disposable master snapshot, while docker-shell-wdmount mounts the current directory so edits, builds and tests happen against your own tree. Apple M1 has limited macOS support through separate targets.

code
$ make docker-images-arm64
$ DOCKER_ARCH=arm64 make docker-shell-wdmount

For non-native images the project points at the qemu-user-static repository.

No comparison numbers, and no release since v2.7.0

Two things an evaluator will look for are simply absent. First, the README's feature list gives no performance comparison or benchmark figures. Second, the release stream is thin. The three most recent releases are v2.7.0 from 2022-02-19, v2.6.0 from 2020-10-13 and v2.5.0 from 2019-11-25, while the default branch was last pushed on 2026-09-04. That push date is recent, but no tag follows v2.7.0, and the incompatible work sits on master. A third limit is where answers come from: the project points at its wiki, a Stack Overflow tag, GitHub issues for bugs and feature requests, and an IRC channel, a different support shape from a project carrying a compatibility matrix or a roadmap in tree.

Editorial conclusion

Duktape fits an embedder who wants a small, vendored interpreter with a three file integration and no runtime dependency, and who is willing to read the Post-ES5 feature status page before committing to a language feature. It does not fit a team that needs full ES2015 coverage, published benchmark numbers, or a stream of tagged releases after v2.7.0. Before you commit, check the feature status page for the exact syntax you need, pin a release tag or a maintenance branch instead of master, and confirm that the duk_config.h generated by tools/configure.py matches the build you actually ship.

Frequently asked questions

What are the main differences between Duktape and QuickJS, and which one is better?

The project documents no comparison with QuickJS. What it states is that Duktape is an embeddable JavaScript engine focused on portability and compact footprint, ECMAScript E5/E5.1 compliant with partial ES2015 and ES2016 support, integrated through duktape.c, duktape.h and duk_config.h, with a Post-ES5 feature status page and the kangax compat table named as the places to check coverage. The README lists no benchmark figures.

Can you provide a list of JavaScript engines, and where does Duktape fit?

Duktape belongs to the embeddable group rather than the standalone interpreter group: there is no runtime to install and no binary to deploy, because a host links duktape.c, duktape.h and duk_config.h into its own build and calls JavaScript in both directions through the Duktape API. The distributable also bundles an optional logging framework, CommonJS based module loading implementations and CBOR bindings. The project does not enumerate other engines.

duktape vs lua: which one for an embeddable script engine?

The project does not compare itself with Lua. It describes Duktape as an embeddable JavaScript engine with a focus on portability and compact footprint, E5/E5.1 compliant with some semantics updated from ES2015+ and partial support for ES2015 and 2016, running combined reference counting and mark-and-sweep garbage collection with finalization. Coroutines are offered as a custom feature.

duktape vs v8: what changes when you pick Duktape instead?

No comparison with V8 appears in the project documentation. The stated scope of Duktape is embedding: three files added to your build, the Duktape API callable from C and vice versa, minimal platform dependencies, a built-in debugger, a built-in regular expression engine, Unicode support, and bytecode dump and load for caching compiled functions. Tying those features to V8 is an evaluation you have to do yourself.

duktape alternative: where do end user downloads and maintained ports live?

For Duktape itself, packaged source distributables are published on duktape.org/download.html, and the end user downloads also live in the svaarala/duktape-releases repository as both binaries and unpacked form as git tags. A Duktape port is installable through vcpkg and is kept up to date by Microsoft team members and community contributors, with an issue or pull request invited when the version falls behind. The project does not list substitute engines.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. svaarala/duktape on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/svaarala-duktape.svg)](https://hysenlabs.com/projects/svaarala-duktape)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/svaarala-duktape.svg)](https://hysenlabs.com/projects/svaarala-duktape)

Was this useful?