From 5721ee513ef99971ad1283a331db255772da4afb Mon Sep 17 00:00:00 2001 From: Yusuf Shakeel Date: Sat, 5 Dec 2020 18:17:32 +0530 Subject: [PATCH 1/3] recording performance in output/PERFORMANCE.md file --- .gitignore | 3 ++- README.md | 2 ++ package.json | 1 + performance/index.js | 6 +++--- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 42a5a4c..d55e209 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ .idea/ docs/ -coverage/ \ No newline at end of file +coverage/ +output/ diff --git a/README.md b/README.md index 80a5179..5b10c37 100644 --- a/README.md +++ b/README.md @@ -684,6 +684,8 @@ To check performance run the following command in the terminal. > npm run performance ``` +Performance will be recorded in `output/PERFORMANCE.md` file. + ## License It's free :smiley: diff --git a/package.json b/package.json index b11e891..666af9b 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "This is a simple coupon creation project using NodeJS.", "main": "index.js", "scripts": { + "project:init": "mkdir -p output && npm i && npm run test", "test": "jest -c jest.config.json", "generate-docs": "npx jsdoc -c jsdocs.config.json", "lint": "npx eslint -c .eslintrc.json ./index.js ./app ./tests ./performance", diff --git a/performance/index.js b/performance/index.js index 7a20217..8d7191f 100644 --- a/performance/index.js +++ b/performance/index.js @@ -4,14 +4,14 @@ const fs = require('fs'); const CouponJS = require('../index.js'); const { startSection } = require('./template.js'); -const maxCoupons = [1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 5e6]; +const maxCoupons = [1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6]; -const couponLengths = [6, 8, 12, 16]; +const couponLengths = [6, 8, 12, 16, 20]; const roundNumbers = [1, 2, 3]; const performanceMdData = { - file: './PERFORMANCE.md', + file: './output/PERFORMANCE.md', timestamp: new Date().toISOString(), divider: '============================================================' }; From f7a74f9cf324e4144cecac542d3a008ade7e8210 Mon Sep 17 00:00:00 2001 From: Yusuf Shakeel Date: Sat, 5 Dec 2020 18:17:50 +0530 Subject: [PATCH 2/3] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b10c37..082d5c7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is a simple coupon creation project using NodeJS. [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/yusufshakeel/couponjs) -[![npm version](https://img.shields.io/badge/npm-0.8.17-blue.svg)](https://www.npmjs.com/package/couponjs) +[![npm version](https://img.shields.io/badge/npm-0.8.18-blue.svg)](https://www.npmjs.com/package/couponjs) [![Build Status](https://travis-ci.com/yusufshakeel/couponjs.svg?branch=master)](https://travis-ci.com/yusufshakeel/couponjs) [![Coverage Status](https://coveralls.io/repos/github/yusufshakeel/couponjs/badge.svg?branch=master)](https://coveralls.io/github/yusufshakeel/couponjs?branch=master) From ebcd3d6e79e1bbe0e58597a0037242a80c911ddb Mon Sep 17 00:00:00 2001 From: Yusuf Shakeel Date: Sat, 5 Dec 2020 18:17:56 +0530 Subject: [PATCH 3/3] 0.8.18 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f367da..f9d4ea2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "couponjs", - "version": "0.8.17", + "version": "0.8.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 666af9b..82009fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "couponjs", - "version": "0.8.17", + "version": "0.8.18", "description": "This is a simple coupon creation project using NodeJS.", "main": "index.js", "scripts": {