Skip to content

Commit

Permalink
fix(package.json): renamed the package
Browse files Browse the repository at this point in the history
Changed package name from randomZ to js-randomize
  • Loading branch information
loveakinlesi committed Jun 25, 2021
1 parent d692ddc commit 8749b06
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RandomZ
# js-randomize

## Table of Contents

Expand All @@ -10,55 +10,55 @@


## Overview
RandomZ is a simple javascript utility to generate random values in your code.
js-randomize is a simple javascript utility to generate random values in your code.


## Installation
Using npm:
```zsh
$ npm install randomz
$ npm install js-randomize
```


## Usage

```js

const randomz = require('randomz');
const random = require('js-randomize');

var randomInteger1 = randomz.int();
var randomInteger1 = random.int();
// randomInteger1 is an integer in range [0, 100]

var randomInteger2 = randomz.int(1,10);
var randomInteger2 = random.int(1,10);
// randomInteger2 is an integer in range [1, 10]


var randomFloat1 = randomz.float();
var randomFloat1 = random.float();
// randomFloat1 is a float in range [0, 100] to 2 d.p

var randomFloat2 = randomz.float(1,10);
var randomFloat2 = random.float(1,10);
// randomFloat2 is a float in range [1, 10] to 2 d.p

var randomFloat3 = randomz.float(1,10, 3);
var randomFloat3 = random.float(1,10, 3);
// randomFloat3 is a float in range [1, 10] to 3 d.p



var randomIntegerArray1 = randomz.intArray(5, 1, 30);
var randomIntegerArray1 = random.intArray(5, 1, 30);
// randomIntegerArray1 is an array of 5 integers in range [1, 30]

var randomIntegerArray2 = randomz.floatArray(5, 1, 30, 3);
var randomIntegerArray2 = random.floatArray(5, 1, 30, 3);
// randomIntegerArray2 is an array of 5 integers in range [1, 30] to 3 d.p


var randomBoolean = randomz.boolean();
var randomBoolean = random.boolean();
// randomBoolean is a boolean

const array = [1,2,3,4,5];
var randomArray1 = randomz.array(array);
var randomArray1 = random.array(array);
// randomArray1 is an array of 1 element from array

var randomArray2 = randomz.array(array, 3);
var randomArray2 = random.array(array, 3);
// randomArray2 is an array of 3 elements from array


Expand All @@ -67,13 +67,13 @@ var randomArray2 = randomz.array(array, 3);
### Typescript
```ts

import randomz from 'randomz';
import random from 'js-randomize';

randomInteger: Number = randomz.int();
randomInteger: Number = random.int();

or

import { int, float, boolean, array, shuffle } from 'randomz';
import { int, float, boolean, array, shuffle } from 'js-randomize';
randomInteger1: Number = int(1, 3);

```
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "randomz",
"name": "js-randomize",
"version": "0.0.0-development",
"description": "Generate random values in your code",
"description": "A simple javascript utility to generate random values in your code",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
Expand All @@ -12,17 +12,17 @@
},
"repository": {
"type": "git",
"url": "https://github.com/iiitma/randomZ.git"
"url": "https://github.com/iiitma/js-randomize.git"
},
"keywords": [
"random"
],
"author": "iiitma",
"license": "MIT",
"bugs": {
"url": "https://github.com/iiitma/randomZ/issues"
"url": "https://github.com/iiitma/js-randomize/issues"
},
"homepage": "https://github.com/iiitma/randomZ#readme",
"homepage": "https://github.com/iiitma/js-randomize#readme",
"devDependencies": {
"chai": "^4.3.4",
"cz-conventional-changelog": "^3.3.0",
Expand Down
18 changes: 9 additions & 9 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var expect = require('chai').expect;
const randomZ = require("../dist/index");
const random = require("../dist/index");
const _ = require('lodash');

describe('Random Integer - int()', function () {
Expand All @@ -16,7 +16,7 @@ describe('Random Integer - int()', function () {
// 2. ACT
let result = []
for (const range of ranges) {
range.length > 1 ? y = randomZ.int(range[0], range[1]) : y = randomZ.int()
range.length > 1 ? y = random.int(range[0], range[1]) : y = random.int()
result.push(y)
}

Expand Down Expand Up @@ -46,7 +46,7 @@ describe('Random Float - float()', function () {
// 2. ACT
let result = []
for (const range of ranges) {
range.length > 1 ? y = randomZ.float(range[0], range[1]) : y = randomZ.float()
range.length > 1 ? y = random.float(range[0], range[1]) : y = random.float()
result.push(y)
}

Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Random Float specified dp - float()', function () {
// 2. ACT
let result = []
for (const range of ranges) {
y = randomZ.float(range[0], range[1], range[2])
y = random.float(range[0], range[1], range[2])
result.push(y)
}

Expand All @@ -102,7 +102,7 @@ describe('Array of Random Integers - intArray()', function () {
// 2. ACT
let result = []
for (const range of ranges) {
y = randomZ.intArray(range[0], range[1], range[2])
y = random.intArray(range[0], range[1], range[2])
result.push(y)
}

Expand Down Expand Up @@ -135,7 +135,7 @@ describe('Array of Random Floats - floatArray()', function () {
// 2. ACT
let result = []
for (const range of ranges) {
y = randomZ.floatArray(range[0], range[1], range[2])
y = random.floatArray(range[0], range[1], range[2])
result.push(y)
}

Expand Down Expand Up @@ -169,7 +169,7 @@ describe('Array of Random Floats specified dp - floatArray()', function () {
// 2. ACT
let result = []
for (const range of ranges) {
y = randomZ.floatArray(range[0], range[1], range[2], range[3])
y = random.floatArray(range[0], range[1], range[2], range[3])
result.push(y)
}

Expand All @@ -195,7 +195,7 @@ describe('Random Boolean - boolean()', function () {
// 2. ACT
let result = []
for (let i = 0; i < runs; i++ ) {
y = randomZ.boolean()
y = random.boolean()
result.push(y)
}

Expand All @@ -217,7 +217,7 @@ describe('Random Array - array()', function () {
// 2. ACT
let result = []
for (const test of tests) {
y = randomZ.array(test[0], test[1])
y = random.array(test[0], test[1])
result.push(y)
}

Expand Down

0 comments on commit 8749b06

Please sign in to comment.