Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pardjs/static-content-loader
Staic content loader
https://github.com/pardjs/static-content-loader
Last synced: 27 days ago
JSON representation
Staic content loader
- Host: GitHub
- URL: https://github.com/pardjs/static-content-loader
- Owner: pardjs
- License: mit
- Created: 2019-05-27T08:35:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T22:44:54.000Z (about 2 years ago)
- Last Synced: 2024-11-21T10:12:45.436Z (about 2 months ago)
- Language: TypeScript
- Homepage: https://pardjs.github.io/static-content-loader/
- Size: 1.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Static content loader
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Build Status](https://travis-ci.com/pardjs/static-content-loader.svg?branch=master)](https://travis-ci.com/pardjs/static-content-loader)
[![Coverage Status](https://coveralls.io/repos/github/pardjs/static-content-loader/badge.svg?branch=master)](https://coveralls.io/github/pardjs/static-content-loader?branch=master)Load static content (.json/.md) from remote and cache in local memory.
---
## Usage
```js
const staticLoader = new StaticContentLodader('https://raw.githubusercontent.com/ole3021/blogs/master/blogs', {
indexFileName: 'customIndex.json',
timeout: 4000
})const indexContent = staticLoader.fetchIndex()
const content = staticLoader.fetchContent('/Knowledge/Pomodoro.md')
```
---### Maintain
```shell
yarn commit # replace `git commit` with help utils
yarn test:watch # run test in watch mode locally
```