1.1.4 • Published 2 months ago

@hckrnews/auto-fetch v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Auto Fetch local/http

NPM version Coverage Scrutinizer Code Quality Quality Gate Status Bugs Code Smells Technical Debt Vulnerabilities Maintainability Rating Reliability Rating Security Rating

With this package you can get local or remote file data like the fetch method.

Example usage

import fetch '@hckrnews/auto-fetch'

const responseLocal = await fetch('./src/__fixtures__/example.json')
const responseRemote = await fetch('https://example.com')

Returns the body as string.

await response.text()

Returns the body parsed as JSON.

await response.json()

Returns the body as ReadableStream.

let result = ''
response.body.on('data', (chunk) => {
    result += chunk
})

response.body.on('end', () => {
    const data = JSON.parse(result)
})
1.1.4

2 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago