Popularity
0.4
Growing
Activity
8.4
Growing
4
2
0

Description

Presentation and transformation layer for data output in RESTful APIs.

Monthly Downloads: 0
Programming language: JavaScript
Tags: JSON     API     REST     Transformer     serialization    

Vicis alternatives and similar modules

Based on the "Serialization" category

Do you think we are missing an alternative of Vicis or a related project?

Add another 'Serialization' Module

README

[Vicis](docs/_media/logo.png?raw=true "Vicis")

Vicis

Presentation and transformation layer for data output in RESTful APIs.

๐Ÿ—Ž Vicis Documentation ๐Ÿ—Ž

NPM Version NPM Downloads Build Status Issues

Known Vulnerabilities Dependency Status devDependencies Status

Maintainability Codacy Badge Quality Gate Status

GitHub stars GitHub watchers GitHub followers GitHub forks

This is Node.js analogue to this libraries:


Tl;dr

Code:

import { Vicis } from "vicis/es";
const configuration = {
  cast: { _id: Vicis.INTEGER, registered: Vicis.FLAG },
  defaults: { confirmed: false },
  exclude: [/(?:password)/gi, /^(?:_)(?:_)?/],
  omit: ["createdAt", "updatedAt", "deletedAt"],
  rename: { _id: "id", email: "login" },
  replace: { url: null }
};
const model = {
  _id: "54759309034942804",
  email: "johnwick@gmail.com",
  userPassword: "36e80092ff7f1ed72903cda9409b9d2c",
  registered: "1",
  url: "example.com",
  createdAt: "2020-01-01 01:23:45",
  __v: 1
};
const serializer = new Vicis(configuration);
serializer.data(model);
console.log(serializer.getData());

Output:

{
  "confirmed": false,
  "id": 54759309034942804,
  "login": "johnwick@gmail.com",
  "registered": true,
  "url": null
}

If you use this project don't forget to give a โญ star โญ to it on GitHub!


Discover more:

  • ๐Ÿ”ŽConsono๐Ÿ”Ž - The most informative and correct variable inspector for JavaScript on the web.

  • ๐ŸŒ OF๐ŸŒ  - Promise wrapper with some sugar.

  • ๐Ÿ”ฉLocal Storage Fallback๐Ÿ”ฉ - Universal localStorage fallback.

  • ๐Ÿ”„Publish Subscribe๐Ÿ”„ - JavaScript implementation of the Publish-Subscribe pattern.

Or find useful these tools:

  • ๐ŸงพJSON Sorter๐Ÿงพ - Neat online JSON sorter.