# exemethod

> "require('exemethod')(); // => npm | script | globalcli | localcli | required | browserify"

Latest version **1.3.1** (published 2016-02-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2016-02-20 |
| First published | 2015-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | serapath |
| Maintainers | serapath |

## Links

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

## Dependencies (1)

- [babelify](https://npm.io/package/babelify.md) ^6.3.0

## Recent versions

- 1.3.1 (latest) — 2016-02-20
- 1.3.0 — 2015-12-22
- 1.2.7 — 2015-12-22
- 1.2.6 — 2015-12-21
- 1.2.5 — 2015-10-14
- 1.2.4 — 2015-07-13
- 1.1.4 — 2015-06-08
- 1.1.3 — 2015-05-18
- 1.1.2 — 2015-05-17
- 1.1.1 — 2015-05-17
- 1.1.0 — 2015-05-15
- 1.0.0 — 2015-05-15

## README

# exemethod
require('exemethod')(); // => npm | script | globalcli | localcli | required | browserify | browser

It will tell your code how it was executed.

## Usage
```js
// [myscript.js]
function customlogger (msg, method) { return method; }

var exemethod = require('exemethod');

var method = exemethod(customlogger);

console.log(method);
```
will result in:
* `npm run myscript` => **npm**
  * (assumes myscript.js is executed in a [package.json].script)
* `./myscript.js` => **script**
  * (assumes `chmod +x myscript.js`)
* `npm install myscript -g` + `myscript` => **globalcli**
  * (assumes [package.json].bin field)
* `node usemyscript.js` => **required**
  * (assumes something like `require('./myscript.js')` in "usemyscript.js")
* `node ./myscript.js` => **localcli**
* `browserify myscript.js > b.js` => **browserify**
* `<script src='b.js'></script>` => **browser**
  * (assumes you load "b.js" in an html page (e.g. via *script tag*))

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