Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 8d81903

Browse files
wdhdevnorisurgit
andauthored
v1.1.4
A release adding new modules and improving the package overall. Co-authored-by: Abdennour Boudjema <nourik27@gmail.com>
1 parent d9c1576 commit 8d81903

18 files changed

Lines changed: 258 additions & 41 deletions

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
<h1 align="center">Easy Script</h1>
66

7+
<h3 align="center"><code>npm install easyscriptjs</code></p></h3>
8+
79
<p align="center">
810
<img alt="Lastest Release" src="https://img.shields.io/github/v/release/easyscriptjs/easyscript?style=for-the-badge">
911
<img alt="GitHub Issues" src="https://img.shields.io/github/issues-raw/easyscriptjs/easyscript?label=Issues&style=for-the-badge">
@@ -12,8 +14,5 @@
1214

1315
<p align="center">Easy Script is a npm package which makes coding in JavaScript easy!</p>
1416

15-
<h2 align="center">Usage</h2>
16-
<p align="center">If you want to learn how to use Easy Script, you can find all of the information you need on the <a href="https://github.com/EasyScriptJS/EasyScript/wiki/Usage">wiki</a>.</p>
17-
18-
<h2 align="center">Modules</h2>
19-
<p align="center">If you want to learn more about Easy Script's modules, you can find information on all of the modules on the <a href="https://github.com/EasyScriptJS/EasyScript/wiki/Modules">wiki</a>.</p>
17+
<h2 align="center">Documentation</h2>
18+
<p align="center">If you want to learn how to use Easy Script, you can find all of the information you need on the <a href="https://docs.easyscript.dev">docs</a>.</p>

package-lock.json

Lines changed: 25 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easyscriptjs",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Easy Script is a npm package which makes coding in JavaScript easy!",
55
"main": "src/index.js",
66
"scripts": {},
@@ -11,14 +11,17 @@
1111
"keywords": [
1212
"easy",
1313
"easyscript",
14-
"javascript",
15-
"js",
16-
"script"
14+
"type-converter",
15+
"types",
16+
"uuid"
1717
],
1818
"author": "Easy Script <packages@easyscript.dev>",
1919
"license": "MIT",
2020
"bugs": {
2121
"url": "https://github.com/EasyScriptJS/EasyScript/issues"
2222
},
23-
"homepage": "https://easyscript.dev"
23+
"homepage": "https://easyscript.dev",
24+
"dependencies": {
25+
"nanoid": "3.3.4"
26+
}
2427
}

src/modules.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
module.exports = {
22
"flip": require("./modules/flip"),
3+
"id": require("./modules/id"),
34
"log": require("./modules/log"),
45
"print": require("./modules/print"),
56
"random": require("./modules/random"),
7+
"types": {
8+
"boolToNum": require("./modules/types/boolToNum"),
9+
"boolToStr": require("./modules/types/boolToStr"),
10+
"numToStr": require("./modules/types/numToStr"),
11+
"strToBool": require("./modules/types/strToBool"),
12+
"strToNum": require("./modules/types/strToNum")
13+
},
614
"util": {
7-
"boolToNum": require("./modules/util/boolToNum"),
8-
"boolToStr": require("./modules/util/boolToStr"),
9-
"numToStr": require("./modules/util/numToStr"),
10-
"strToBool": require("./modules/util/strToBool"),
11-
"strToNum": require("./modules/util/strToNum")
15+
"removeDuplicates": require("./modules/util/removeDuplicates")
1216
},
1317
"uuid": require("./modules/uuid")
1418
}

src/modules/flip.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
module.exports = function coinflip() {
1+
function flip() {
22
return Math.random() >= 0.5 ? "heads" : "tails";
3-
}
3+
}
4+
5+
module.exports = flip;

src/modules/id.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { customAlphabet } = require("nanoid");
2+
3+
function id(length) {
4+
if(!length) throw new Error("No length specified");
5+
if(typeof length !== "number") throw new Error("Invalid type specified");
6+
7+
if(length > 64) throw new Error("Length cannot be more than 64");
8+
9+
const nanoid = customAlphabet("1234567890abcdefghijklmnopqrstuvwxyz", length);
10+
const id = nanoid();
11+
12+
return id;
13+
}
14+
15+
module.exports = id;

src/modules/log.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
module.exports = function log(input) {
1+
function log(input) {
22
if(!input) {
33
throw new Error("No input specified");
44
}
55

66
return console.log(input);
7-
}
7+
}
8+
9+
module.exports = log;

src/modules/print.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
module.exports = function print(input) {
1+
function print(input) {
22
if(!input) {
33
throw new Error("No input specified");
44
}
55

66
return console.log(input);
7-
}
7+
}
8+
9+
module.exports = print;

src/modules/random.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function random(max) {
1+
function random(max) {
22
let highest = 100;
33

44
if(max && !isFinite(max)) throw new Error("Max number must be a number");
@@ -9,4 +9,6 @@ module.exports = function random(max) {
99
const result = Math.floor((Math.random() * highest) + 1);
1010

1111
return result;
12-
}
12+
}
13+
14+
module.exports = random;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function boolToNum(boolean) {
1+
function boolToNum(boolean) {
22
if(typeof boolean !== "boolean") throw new Error("No boolean provided");
33

44
let res;
@@ -7,4 +7,6 @@ module.exports = function boolToNum(boolean) {
77
if(!boolean) res = + false;
88

99
return res;
10-
}
10+
}
11+
12+
module.exports = boolToNum;

0 commit comments

Comments
 (0)