This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const yargs = require("yargs"); | |
const robot = require("robotjs"); | |
const { hideBin } = require("yargs/helpers"); | |
let is_both; | |
let is_mouse; | |
let is_keyboard; | |
const arg = yargs(hideBin(process.argv)) | |
.command("$0 [interval]", true, (yargs) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js | |
let counter = 0; | |
const generateId = () => {/* */}; | |
class StudentManagement { | |
constructor() {/**/} | |
add() {/**/} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js | |
let counter = 0 | |
const generateId = () => { /* */} | |
class StudentManagement { /* */ } | |
module.exports = StudentManagement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js | |
let counter = 0; | |
const generateId = () => {/* */}; | |
class StudentManagement { | |
constructor() {/* */} | |
add() {/* */} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.test.js | |
const assert = require("assert") | |
const StudentManagement = require("./index") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js | |
let counter = 0; | |
const generateId = () => { | |
++counter; | |
return counter; | |
}; | |
class StudentManagement { | |
#students = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// demo.js | |
const StudentManagement = require("./index") | |
const classA = new StudentManagement(["Abel", "Ben", "Cain"]) | |
console.log("Intial Students: \n", classA.getStudent()) | |
// adding two new students | |
classA.add("Daniel", "Evelyn") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install mocha --save-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//. | |
"scripts": { | |
"test": "mocha index.test.js" | |
}, | |
//.. |
OlderNewer