# path-loader

> Utility that provides a single API for loading the content of a path/URL.

Latest version **1.0.12** (published 2022-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-loader
pnpm add path-loader
yarn add path-loader
bun add path-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2022-06-14 |
| First published | 2015-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 665.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jeremy Whitlock |
| Maintainers | whitlockjc |
| Keywords | json |

## Links

- npm: https://www.npmjs.com/package/path-loader
- Repository: https://github.com/whitlockjc/path-loader
- Issues: https://github.com/whitlockjc/path-loader/issues
- npm.io page: https://npm.io/package/path-loader

## Dependencies (2)

- [superagent](https://npm.io/package/superagent.md) ^7.1.6
- [native-promise-only](https://npm.io/package/native-promise-only.md) ^0.8.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.12 (latest) — 2022-06-14
- 1.0.11 — 2022-06-11
- 1.0.10 — 2019-04-01
- 1.0.9 — 2018-09-06
- 1.0.8 — 2018-08-31
- 1.0.7 — 2018-08-26
- 1.0.6 — 2018-08-08
- 1.0.5 — 2018-08-05
- 1.0.4 — 2017-10-09
- 1.0.2 — 2017-04-13
- 1.0.1 — 2015-12-21
- 1.0.0 — 2015-12-21
- 0.3.2 — 2015-12-16
- 0.3.1 — 2015-12-16
- 0.3.0 — 2015-12-16
- … 6 more at https://npm.io/package/path-loader/versions

## README

# path-loader

Utility that provides a single API for loading the content of a path/URL.  This module works in the browser and in
io.js/Node.js.  Right now this module supports the following loaders:

* http/https: This loader is used by default in the browser and will also be used in io.js/Node.js if the location being
loaded starts with `http:` or `https:`
* file: This loader is the used by default in io.js/Node.js and will throw an error in the browser _(Due to how
locations are mapped to loaders, the only way to use the `file` loader in the browser is to attempt to load a file using
the URL-version of its location.  (Example: `file:///Users/not-you/projects/path-loader/package.json`))_

In the future, there will likely be a pluggable infrastructure for altering this list or overriding the loaders provided
by the project but for now that is not an option.

## Project Badges

* Build status: [![Build Status](https://travis-ci.org/whitlockjc/path-loader.svg)](https://travis-ci.org/whitlockjc/path-loader)
* Downloads: [![NPM Downloads Per Month](http://img.shields.io/npm/dm/path-loader.svg)](https://www.npmjs.org/package/path-loader)
* Gitter: [![Join the chat at https://gitter.im/whitlockjc/path-loader](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/whitlockjc/path-loader?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* License: [![License](http://img.shields.io/npm/l/path-loader.svg)](https://github.com/whitlockjc/path-loader/blob/master/LICENSE)
* Version: [![NPM Version](http://img.shields.io/npm/v/path-loader.svg)](https://www.npmjs.org/package/path-loader)

## Installation

path-loader is available for both Node.js and the browser.  Installation instructions for each environment are below.

### Browser

path-loader binaries for the browser are available in the `dist/` directory:

* [path-loader.js](https://raw.github.com/whitlockjc/path-loader/master/dist/path-loader.js): _288kb_, full source  and source maps
* [path-loader-min.js](https://raw.github.com/whitlockjc/path-loader/master/dist/path-loader-min.js): _32kb_, minified, compressed and no sourcemap

### Node.js

Installation for Node.js applications can be done via [NPM][npm].

```
npm install path-loader --save
```

## Documentation

The documentation for this project can be found here: https://github.com/whitlockjc/path-loader/blob/master/docs/README.md

The path-loader project's API documentation can be found here: https://github.com/whitlockjc/path-loader/blob/master/docs/API.md

## Dependencies

Below is the list of projects being used by path-loader and the purpose(s) they are used for:

* [native-promise-only][native-promise-only]: Used to shim in [Promises][promises] support
* [superagent][superagent]: AJAX for the browser and Node.js

[native-promise-only]: https://www.npmjs.com/package/native-promise-only
[npm]: https://www.npmjs.org/
[promises]: https://www.promisejs.org/
[superagent]: https://github.com/visionmedia/superagent

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