What is Antithesis? How we’re different Problems we solve Security approach Demo Fintech Customer stories Working with Antithesis Contact us Backstory Leadership Careers Brand

JavaScript SDK

Contact us about the availability of the JavaScript SDK.

JavaScript instrumentation

The Antithesis platform can automatically instrument JavaScript code by performing a source transformation after you’ve sent it to us. No changes to your source code or build system are required. Our instrumentor assumes by default that you are using NodeJS as your runtime – contact us if you’d like to use a different runtime. We do not support instrumenting JavaScript code that runs in a browser.

NodeJS

Place directories, files, or symlinks to the code you want instrumented or cataloged in the directory /opt/antithesis/catalog/ within your container image. Antithesis will follow all symlinks while resolving the path to the cataloging directory.

However, it will follow only one symlink deep into each item placed within /opt/antithesis/catalog/. That is, you should not symlink to a symlink.

Example cataloging directory:

> ln -s /usr/share/my_app /opt/antithesis/catalog 

> ls -lAh /opt/antithesis/catalog
lrwxrwxrwx  1 me users 4 Apr  8 17:32 /opt/antithesis/catalog -> /usr/share/my_app

> ls -lAh /opt/antithesis/catalog/
-rwxr-xr-x  1 me users  20K Apr  8 17:33 dotnet_file.dll
lrwxrwxrwx  1 me users 27 Apr  8 17:52 more_files -> /opt/my_project/java_files 
-rwxr-xr-x  1 me users  10K Apr  8 17:33 python_script.py

> ls -lA /opt/antithesis/catalog/more_files/
-rw-r--r--  1 me users  16K Apr  8 17:51 main.jar
lrwxrwxrwx  1 me users  16K Apr  8 17:51 my_other.jar -> /some/other/place.jar

Based on the example above, the following files would be instrumented:

  • dotnet_file.dll
  • python_script.py
  • main.jar

Ignored files:

  • my_other.jar - this will be ignored as we already encountered one symlink when traversing down from opt/antithesis/catalog/more_files.

When instrumenting Javascript, the instrumentor will search for directories containing node_modules and recursively instrument all of the code within said directories; however, it will by default exclude everything in node_modules and some standard configuration files that happen to be implemented as JavaScript (for instance eslint.config.js). It follows that vendored dependencies will be instrumented by default.

The instrumentor will, by default, act upon every language it supports in the cataloging directory: (Java , Python, JavaScript, .NET), not just JavaScript.

For dependency management, Antithesis supports require by default, but can be configured to support import – please speak to your professional services consultant.

JS-target languages

Antithesis can instrument projects in JavaScript-target languages such as TypeScript if you provide us with transpiled JavaScript code. Transpilation must happen before you send us the code (as part of your build process), rather than at service startup.

Symbolization

Antithesis will automatically gather the symbol information from your code. You do not need to separately provide us with symbol files.

Help

Contact us if you need help with this.

  • Introduction
  • How Antithesis Works
  • Tutorial
  • Testing with Antithesis
  • Build and run an etcd cluster
  • Meet the Test Composer
  • User manual
  • Setup guide
  • Properties and Assertions
  • Properties in Antithesis
  • Assertions in Antithesis
  • Sometimes Assertions
  • Properties to Test For
  • Test Composer
  • Test Composer Basics
  • Test Composer Reference
  • Principles of Test Composition
  • Checking Test Templates Locally
  • Webhooks
  • Launching a test
  • Retrieving logs
  • Launching a debugging session
  • Webhook API
  • Reports
  • The triage report
  • Findings
  • Environment
  • Utilization
  • Properties
  • The bug report
  • Context, Instance, & Logs
  • Bug likelihood over time
  • Statistical debug information
  • Multiverse debugging
  • Overview
  • Exploring the multiverse
  • Querying with event sets
  • The Environment and its utilities
  • Using the Antithesis Notebook
  • Cookbook
  • The Environment and Multiverse
  • The Antithesis Environment
  • Fault Injection
  • CPUID
  • Reference
  • Handling External Dependencies
  • SDK reference
  • Go
  • Tutorial
  • Instrumentor
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Java
  • Tutorial
  • Instrumentation
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • C
  • C++
  • Tutorial
  • C/C++ Instrumentation
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • JavaScript
  • Python
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Rust
  • Tutorial
  • Instrumentation
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • .NET
  • Languages not listed above
  • Assert (reference)
  • Lifecycle (reference)
  • Tooling integrations
  • CI integration
  • Discord and Slack integrations
  • Configuring Antithesis
  • Instrumentation
  • User management
  • Sizing your deployment
  • Best practices
  • Docker best practices
  • Is Antithesis working?
  • Optimizing for Antithesis
  • Finding more bugs
  • FAQ
  • About Antithesis POCs
  • Release notes
  • Release notes