1.2.7 • Published 2 months ago

@hckrnews/local-fetch v1.2.7

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

Local Fetch

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 file data like the fetch method.

Example usage

import localFetchfrom '@hckrnews/local-fetch'

const fetch = await localFetcher('file:///Users/pieter.wigboldus/projects/local-fetch/src/__fixtures__/example.json')

Returns the body as string.

fetch.text()

Returns the body parsed as JSON.

fetch.json()

Returns the body as ReadableStream.

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

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

2 months ago

1.2.6

5 months ago

1.2.5

5 months ago

1.2.4

6 months ago

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago