0.1.2 • Published 6 years ago

fake-users-alesscuderi v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

fake-users-alesscuderi

This is a simple package that manipulates the mock of an array of users.

Installation

npm i fake-users-alesscuderi

Usage

You can use one of the following functions.

var fakeusers = require('fake-users-alesscuderi');

console.log(this.getAll());

prints the array

console.log(this.getUserById(3));

returns the user with the given id

console.log(this.addUser({
  name: 'John',
  surname: 'Doe'
}));

Adds an user to the array


console.log(this.deleteUser(1));

Deletes the user with the given id

console.log(this.editUser(2, {
  name: 'John',
  surname: 'Doe'
}));

replaces the information of the user at the given position with new ones

console.log(this.resetUsers());

resets any modification made to the array.