https://github.com/getappmap/appmap-node
AppMap client agent for Node.js
https://github.com/getappmap/appmap-node
Last synced: 4 months ago
JSON representation
AppMap client agent for Node.js
- Host: GitHub
- URL: https://github.com/getappmap/appmap-node
- Owner: getappmap
- License: other
- Created: 2023-09-11T15:24:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-27T08:43:16.000Z (over 1 year ago)
- Last Synced: 2025-05-24T20:17:23.716Z (about 1 year ago)
- Language: TypeScript
- Size: 240 MB
- Stars: 10
- Watchers: 4
- Forks: 4
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# appmap-node
AppMap agent for Node.js.
See the [official documentation](https://appmap.io/docs/reference/appmap-node.html) for full reference.
## Usage
Simply use `appmap-node` in place of `node` command, or prepend `appmap-node`
to your tool invocation:
$ npx appmap-node foo.js
$ npx appmap-node yarn jest
$ npx appmap-node npx ts-node foo.ts
## Code Block Recording
You can run appmap-node and use the exposed API to record snippets
of interest.
$ npx appmap-node foo.js
foo.js
```JavaScript
const { record } = require("appmap-node");
const appmap = record(() => {
hello("world");
});
// You can consume the details of the appmap object
console.log("# of events: ", appmap?.events.length);
```
## Configuration
You can create `appmap.yml` config file; if not found, a default one will be created:
```yaml
name: application-name # from package.json by default
appmap_dir: tmp/appmap
language: javascript
packages:
- path: . # paths to instrument, relative to appmap.yml location
exclude: # code to exclude from instrumentation
- node_modules # these paths are excluded by default
- .yaml # if you create your own config file, you probably want to add them too
# You can also exclude methods and functions by name:
# - functionName
# - Klass.method
```