rollup / awesome

⚡️ Delightful Rollup Plugins, Packages, and Resources
MIT License
2.55k stars 139 forks source link

add: jsonlines plugin #111

Closed petlack closed 1 year ago

petlack commented 1 year ago

Awesome Contribution Checklist:

Please Provide a Link A Repository for Your Addition

https://github.com/petlack/rollup-plugin-jsonlines

Please Describe Your Addition

Import .jsonl (JSON Lines) files as JSON arrays.

fruits.jsonl

{ "type": "apples", "count": 7 }
{ "type": "pears", "count": 4 }
{ "type": "bananas", "count": 5 }

index.js

import fruits from './fruits.jsonl';

console.log(fruits);

log

[
  { "type": "apples", "count": 7 },
  { "type": "pears", "count": 4 },
  { "type": "bananas", "count": 5 }
]