https://github.com/jacarte/anilizer
Getting function coverage in NodeJS applications, including node_modules folder
https://github.com/jacarte/anilizer
babel nodejs
Last synced: about 2 months ago
JSON representation
Getting function coverage in NodeJS applications, including node_modules folder
- Host: GitHub
- URL: https://github.com/jacarte/anilizer
- Owner: Jacarte
- Created: 2019-05-22T20:20:33.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-22T20:41:48.000Z (about 7 years ago)
- Last Synced: 2025-04-27T01:44:00.857Z (about 1 year ago)
- Topics: babel, nodejs
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Almost No Instrusive Analizer (ANIlizer)
We try to instrument a complete NodeJS application (including node_modules folder recursivelly) getting the function entering traces. Basically we send the traces using the builtin function **console.debug**, these console api calls can be detected using debugger tools through the websocket channel.
```js
function a(){
console.debug("1:2:1:4", 'FUNCTION_ENTRANCE', 'a', 'file.js')
// node hash, action, functionName filename
// Function code
}
```
### Running the instrumented code
1. Execute ```node src/scripts/instrument_application.js ```
11. There is a map file (**map.json**) with the instrumented functions in the output folder root (Example)
2. Execute the application entrypoint with node **--inspect** option: ```node --inspect entry.js```
3. Execute the listener who writes the logs to **logs/logs.txt** file: ```node src/core/listener/listener.js /map.json```
31. The logs line by line format is **[HASH]:[file_path] [TIMESTAMP]** (Example)
### TODOS
- Debloat based on traces information
- Perform instrumentation to branch level