0.2.7 • Published 6 years ago

url-cached v0.2.7

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

URL-Cached

Load and cache content from any url address.


Install

yarn add url-cached # npm i url-cached

Usage

import UrlCached from 'url-cached'

const urlcached = UrlCached({
  cacheDir?: string | '~/.url-cached'
  reload?: boolean | false // true means all old file will be download again
  expire?: number | 0 // 0 means no expire, only download onece
  retryInterval?: number | 0 // 0 means no retry, fatal will not download again
})

// read(url: string, encoding: string): Promise<string>
await urlcached.read('https://unpkg.com/deno_testing@0.0.5/testing.ts')


// createReadStream(url: string): Readable
urlcached.createReadStream('https://unpkg.com/deno_testing@0.0.5/testing.ts')

If url protocol is file:, urlencode will just read and return file content.

License

MIT License

0.2.7

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago