# tangler

> Use ES2015 modules with node today

Latest version **0.2.3** (published 2017-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install tangler
pnpm add tangler
yarn add tangler
bun add tangler
```

Provides the command `tangler`.

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2017-09-04 |
| First published | 2016-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gabriel Ratener |
| Maintainers | gratener |
| Keywords | module, es6, node |

## Links

- npm: https://www.npmjs.com/package/tangler
- Repository: https://github.com/GabrielRatener/tangler
- Homepage: https://github.com/GabrielRatener/tangler#readme
- Issues: https://github.com/GabrielRatener/tangler/issues
- npm.io page: https://npm.io/package/tangler

## Dependencies (6)

- [acorn](https://npm.io/package/acorn.md) ^3.3.0
- [resolve](https://npm.io/package/resolve.md) ^1.1.7
- [escodegen](https://npm.io/package/escodegen.md) github:estools/escodegen
- [source-map](https://npm.io/package/source-map.md) ^0.5.6
- [acorn-es7-plugin](https://npm.io/package/acorn-es7-plugin.md) ^1.1.7
- [bizubee-compiler](https://npm.io/package/bizubee-compiler.md) ^0.2.3

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2017-09-04
- 0.2.2 — 2017-08-30
- 0.2.1 — 2017-07-27
- 0.2.0 — 2017-07-27
- 0.1.0 — 2016-08-12
- 0.0.3 — 2016-08-08
- 0.0.2 — 2016-07-21
- 0.0.1 — 2016-07-10

## README

# Tangler

#### Use [ES6 modules](http://www.2ality.com/2014/09/es6-modules-final.html) in Node.js, today!

## Install

```
$ npm install -g tangler    # install globally
$ npm install tangler       # install as local dependency
```

## API

Tangler exports two functions, `require` and `run`.

* `tangler.require(path, origin = null, options = {})`

    Require an ES6 module. All properties are bindings to the variables exported from the module. The `default` property is the binding to the module's default value, if present.
* `tangler.run(path, origin = null, options = {})`

    Run an ES6 module from entry point path. Any exported values from the module being run will throw an error
* `tangler.transformStack(stackTrace)`
	
	Returns a transformed stack trace that uses source maps to provide accurate error locations in the source.

If origin is `null` or unspecified, module paths will be resolved from the current working directory.

Usage

```js
var tangler = require('tangler');

// for better error reporting
process.on('uncaughtException', (err) => {
	console.log(tangler.transformStack(err.stack));
	process.exit(1);
});

var myImportedModule = tangler.require('path/to/module', __dirname);

console.log(myImportedModule.someExportedFunction());

```
    
## Command

Tangler comes with a command if installed globally, it takes no options curre

```
$ tangler path/to/module/entry.js
```
 Equivalent to calling
 ```js
 tangler.run('path/to/module/entry.js');
 ```

---
_Source: https://npm.io/package/tangler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
