@21epub/epub-data-client
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

@21epub/epub-data-client

data api client for epub

NPM JavaScript Style Guide Build Status Codecov

Intro

Well, This is a data client for Epub . ( Can be reformed for other Usage )

Feature

  • [x] Easy-to-use
  • [x] Typescript Only
  • [x] RestFul data client support
  • [x] Object Client support
  • [x] Local data manupulate
  • [x] Hooks for data client
  • [x] Both for web and node supported
  • [x] Uniform the error catch for both http error and response code error

Install

npm install --save @21epub/epub-data-client

Usage

import { DataClient } from '@21epub/epub-data-client'

const client = new DataClient('http://url.to/data/')

client.getAll()

class Example extends Component {
  data = client.useData()
  render() {
    return (
      <>
        <div> Total Data: {data?.length} </div>
      </>
    )
  }
}

For Details: See Example

Developing and running on localhost

First install dependencies and then install peerDeps for parcel dev:

npm install
npm run install-peers

To run Example in hot module reloading mode:

npm start

To create a parcel example production build:

npm run build-prod

To create a bundle library module build:

npm run build

To update documentation

npm run doc

Running

Open the file dist/index.html in your browser

Testing

To run unit tests:

npm test

License

MIT © 21epub

Readme

Keywords

Package Sidebar

Install

npm i @21epub/epub-data-client

Weekly Downloads

7

Version

0.5.1

License

MIT

Unpacked Size

267 kB

Total Files

32

Last publish

Collaborators

  • csj117
  • gary.guzy
  • zhangwei0126
  • dxsix
  • wagon1104
  • ongyuxing