# lobal

> Use the local version of global npm modules

Latest version **1.0.2** (published 2014-12-09) · MIT license · 0 weekly downloads

## Install

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

Provides the command `lobal`.

## 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.0.2 |
| Published | 2014-12-09 |
| First published | 2014-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rob Middleton |
| Maintainers | themiddleman |
| Keywords | npm, global, local, bash, shell, binary, execute, run |

## Links

- npm: https://www.npmjs.com/package/lobal
- Repository: https://github.com/Rob-ot/lobal
- Issues: https://github.com/Rob-ot/lobal/issues
- npm.io page: https://npm.io/package/lobal

## Dependencies (5)

- [npm](https://npm.io/package/npm.md) ^2.1.11
- [async](https://npm.io/package/async.md) ^0.9.0
- [osenv](https://npm.io/package/osenv.md) ^0.1.0
- [findup](https://npm.io/package/findup.md) ^0.1.5
- [nomnom](https://npm.io/package/nomnom.md) ^1.8.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2014-12-09
- 1.0.1 — 2014-12-09
- 1.0.0 — 2014-12-09

## README

# lobal

You have lots of projects on your computer. Some require different versions of global npm modules.

Sick of typing ./node_modules/.bin/gulp to use the local gulp binary?

lobal to the rescue!

```bash
# install lobal
$ npm install -g lobal

# add a shim
$ lobal add coffee

# lobal uses the locally installed coffee binary
$ cd ~/project1
~/project1$ npm install coffee-script@1.7.0
~/project1$ coffee -v
CoffeeScript version 1.7.0
~/project1$ cd ../project2$
~/project2$ npm install coffee-script@1.8.1
~/project2$ coffee -v
CoffeeScript version 1.8.1

# lobal will also use the globally installed module if you arent in a project directory
~/project2$ npm install -g coffee-script@1.6.0
~/project2$ cd ~
$ coffee -v
CoffeeScript version 1.6.0
```

## API

#### lobal add `module`

Add a shim named `module`

#### lobal remove `module`

Remove a shim named `module`

#### lobal exec `module`

Look for the `module` binary locally or globally and execute the file.


## How it works

The first time you add a shim local will create a .lobal_shims folder in your home folder and add that folder to your PATH by modifying your .bashrc, .bash_profile, or .profile file.

Shims are just tiny shell scripts that are added to the .lobal_shims folder. The shim scripts just run `lobal exec` passing your module name, ex: `lobal exec coffee`.

lobal exec then finds your current project based on your cwd and looks for the specified module there. If the module isn't found in the current project lobal checks to see if the module is installed globally. Once it has found a module lobal executes the file using child_process.spawn with stdio set to 'inherit'.

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