# parcel-plugin-json-extended

> Provide the option to load either a path or JSON data from a JSON file within Parcel

Latest version **0.1.2** (published 2019-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install parcel-plugin-json-extended
pnpm add parcel-plugin-json-extended
yarn add parcel-plugin-json-extended
bun add parcel-plugin-json-extended
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-10-05 |
| First published | 2019-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | eltrhn |
| Maintainers | eltrhn |

## Links

- npm: https://www.npmjs.com/package/parcel-plugin-json-extended
- npm.io page: https://npm.io/package/parcel-plugin-json-extended

## Recent versions

- 0.1.2 (latest) — 2019-10-05
- 0.1.1 — 2019-10-02
- 0.1.0 — 2019-10-02

## README

# parcel-plugin-json-url-or-data-loader
![DUB](https://img.shields.io/dub/l/vibe-d.svg)

## What
Expands upon the functionality of [parcel-plugin-json-url-loader](https://github.com/shunia/parcel-plugin-url-loader):
```js
// imports JSON object
import { data as foo } from 'path/to/file.json';

// imports file URL
import { url as bar } from 'path/to/file.json';
```

(The remainder of this README is unmodified except for codeblocks)

## Why
Lots of users inculding me are suffered from the build-in feature of `parcel` which bundles `json` file as strings into the final bundler by default [parcel-bundler#501](https://github.com/parcel-bundler/parcel/issues/501). When people are looking for the official solutions, `parcel` is still waiting for the solution from react community [devongovett@parcel-bundler#501](https://github.com/parcel-bundler/parcel/issues/501#issuecomment-357883317). As a matter of fact, it's something easy to hanle with `parcel`'s plugin system. So I made this.

## Installation
```
yarn add --dev parcel-plugin-json-extended
  or
npm install --save-dev parcel-plugin-json-extended
```

## Usage
There is no options for you to think of. Just install it and checkout the output:
```
const asset = require('path/to/json/file.json');
console.log(asset.url); // /file.3a855491.json
console.log(asset.data); // { json object... }
```

## Contribution
There are no tests yet, no linters, no production grade garrentee, and works simply as possible. Any feature requests or bugfixes are welcome.

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