callstack / callstack/haul

Node API

Open
#326 3 comments 0 reactions 0 assignees View on GitHub
1.x enhancement help wanted
Dominant language
TypeScript
Stars
3.7k
Forks
185
PR merge metrics
No merged PRs in 30d

Description

To use the Node API, you need to create a compiler:

```js
// Spawn a worker with the specified options.
const compiler = Haul.create({
platform: 'android',
context: process.cwd(),
production: false,
minify: false,
bundle: false,
port: 3021,
config: require('./haul.config.js'),
});

// Trigger a build
compiler.build()
.map(result => match (result.type) {
'success': `Bundle built in ${result.duration}`,
'error': `Failed to build bundle`,
else: null,
})
.filter(Boolean)
.subscribe(console.log);

// Symbolicate
compiler.symbolicate(frames)
.subscribe(result => console.log(result.stack));

// Kill the server and cleanup
compiler.destroy();
```

This issue assumes that #287 is done.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.