ogio
v0.4.0
Published
Be real OG, fetch everything with g(). File and web I/O combined.
Downloads
4
Readme
OG I/O... what it's all 'bout?
Install
npm i ogio
require("ogio")
Fetch!
"file.txt".g()
// => This is a text
await "@file.txt".g()
// => This is the same text, but async
"file.json".g()
// => {txt: "Parsed json"}
await "https://example.com".g()
// => <html> ... </html>
await "https://example.com/file.json".g()
// => {txt: "Parsed json from example.com"}
Save!
"file.txt".s("This will be a text")
// => This will be a text
await "@file.txt".s("The same text, but async")
// => The same text, but async
"file.json".s({txt:"json smth"})
// => {
// "txt": "json smth"
// }
...More stuff is coming