# typescript-plugin-json

> ## Usage install

Latest version **0.0.2** (published 2020-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install typescript-plugin-json
pnpm add typescript-plugin-json
yarn add typescript-plugin-json
bun add typescript-plugin-json
```

## 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.0.2 |
| Published | 2020-11-12 |
| First published | 2020-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | stepancar |
| Maintainers | stepain |
| Keywords | json, modules, plugin, typescript |

## Links

- npm: https://www.npmjs.com/package/typescript-plugin-json
- Repository: https://github.com/stepancar/typescript-plugin-json
- Issues: https://github.com/stepancar/typescript-plugin-json/issues
- npm.io page: https://npm.io/package/typescript-plugin-json

## Dependencies (1)

- [typescript](https://npm.io/package/typescript.md) ^3.8.3

## 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

- 0.0.2 (latest) — 2020-11-12
- 0.0.1-beta.0 — 2020-11-11
- 0.0.1 — 2020-11-11

## README

# typescript-plugin-json

## Usage
install

```bash
npm install typescript-plugin-json -D
```

```bash
yarn add typescript-plugin-json -D
```

add it to your tsconfig.json
```
"compilerOptions": {
    "plugins": [
        { "name": "typescript-plugin-json" },
    ]
}
```

data.json

```json
{
    "foo": "BAR"
}
```

*.ts
```typescript
import data from './data.json';

console.log(data.foo);

```

Try to cast json setting consts to strings



- 2 interation

type generated automatically from json
algoritm
- read json as is
- each string replace to 'stringvalue as const'

possible problems
conflict with native typscript json module resolver
solutions: new extension or introducing somthing like module.json, disable native typescript json module resolver

type A = {

    foo: 'sdfsdf'
}

function f(a: A) {

}

const b = {
    foo: 'asdasd'
};

f(b);

f({
    foo: 'asdasd'
})

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