New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

servidio

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

servidio

JavaScript Frontend Services Library

unpublished
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Servidio

JavaScript Frontend Services

NPM Version GitHub Top Language Code Size

NPM Downloads Codacy Badge Maintainability

Summary

Overview
Package
CDN
Download
Content
Test
Usage for Vue3 + NPM

Overview

Servidio is a JavaScript Frontend Service Library.
You will find some Services with Checkers, Fetchers, Getters & Setters.
Servidio use only JS native functions, so it have no dependencies.

Package

NPM : npm i servidio
or
Yarn : yarn add servidio

CDN

Download

Latest Release
or
git clone https://github.com/philippebeck/servidio.git
or
Master ZIP

Content

Checkers part :

  • checkError(error) : check error response
  • checkId(id, array) : check id from array
  • 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 :

  • fetchGet(url) get data with fetch
  • fetchSet(url, options) set data with fetch

Getters part :

  • getAverage(id, array) get average from product score
  • getCats(items) get categories from an array of objects
  • getItemName(id, items) get image name
  • getItemsByCat(items) get items by category property

Setters part :

  • setGlobalMeta(lang, icon, creator) set html lang, favicon & meta creator for tw
  • setMeta(title, description, url, image) set all meta for pages
  • setDescription(description) set meta description & description for og/tw
  • setImage(image) set image for og & tw
  • setTitle(title) set head title & title for og/tw
  • setUrl(url) set canonical & url/site for og/tw

Test

You can run unit tests with Jest :
npm test -- --coverage

Usage for Vue3 + NPM

  • In main.js of Vue3, import servidio like this : import serve from "servidio"
  • Then, add this line after creating App but before mounting : app.config.globalProperties.$serve = serve (example)
  • Then use it in yours components like in these examples :
    • this.$serve.fetchGet(url) (example)
    • this.$serve.fetchSet(url, options)
    • this.$serve.checkRegex(message.email, message, regex) (example)
    • this.$serve.checkRange(user.name, message)

Keywords

JavaScript

FAQs

Package last updated on 10 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts