JavaScript Frontend Services
Overview
Package
CDN
Download
Content
Test
Servidio is a JavaScript Frontend Service Library.
You will find some Services with Checkers, Fetchers, Getters & Setters.
Servidio use only Axios as dependency.
NPM : npm i servidio
or
Yarn : yarn add servidio
- Development : https://cdn.jsdelivr.net/npm/[email protected]/dist/serve.js
- Production : https://cdn.jsdelivr.net/npm/[email protected]/dist/serve.min.js
Latest Release
or
git clone https://github.com/philippebeck/servidio.git
or
Master ZIP
Checkers part :
- checkRange(value, message, min, max) : check range between min & max
- checkRegex(value, message, regex) : check value with regex
- checkRole(userRole, role) check role between admin, editor or user
Fetchers part :
- setAxios(token, type) set axios params
- postData(url, data, token, type) post data with axios
- getData(url, token, type) get data with axios
- putData(url, data, token, type) put data with axios
- deleteData(url, token, type) delete data with axios
Getters part :
- getCats(items) get categories from an array of objects
- getItemName(id, items) get image name
- getItemsByCat(items, sortBy) get items by category property
Setters part :
- setError(error) : set error message
- setGlobalMeta(lang, icon) set html lang & favicon
- setMeta(title, description, url, image) set all meta for pages
You can run unit tests with Jest :
npm test