# npm-browser

> install npm packages in browser

Latest version **1.0.0** (published 2021-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install npm-browser
pnpm add npm-browser
yarn add npm-browser
bun add npm-browser
```

## 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.0 |
| Published | 2021-02-28 |
| First published | 2021-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cris Fandiño |
| Maintainers | darkcris1 |
| Keywords | npm, browser, package, installer, requirejs, browserify, unpkg |

## Links

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

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-02-28

## README

# npm-browser

Install like a node package manager in the browser 

Think of this as [requirejs](https://requirejs.org) but in a lighter version

- Lightweight (1kb)
- No Dependencies

## Installation

Unpkg

```html
<script src="https://unpkg.com/npm-browser"></script>
```

# Usage

```html
<script src="https://unpkg.com/npm-browser"></script>
<script>
	npm("sweetalert jQuery",(swal,$)=>{
		swal("Hello world")
		$("body").on("click",()=>{
			alert("hello world")
		})
	})
	
	// Specify the version
	npm("sweetalert@1.0.0",(swal)=>{
		swal("...")
	})
</script>
```
> Packages name must be separated by spaces just like installing a package on npm

> **TIP**: spaces can be many as you want

The base url of this package was **https://unpkg.com/**
if you dont want the default baseUrl you can change it via:

```javascript
npm.baseUrl = "https://cdn.jsdelivr.net/npm/"
```

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