Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

### Links and Resources

- [submission PR](https://github.com/wolfes-401-advanced-javascript/notes/pull/1)
- [submission PR 1](https://github.com/wolfes-401-advanced-javascript/notes/pull/1)
- [submission PR 2](https://github.com/wolfes-401-advanced-javascript/notes/pull/2)
- [ci/cd](http://xyz.com) (GitHub Actions)
- [back-end server url](http://xyz.com) (when applicable)
- [front-end application](http://xyz.com) (when applicable)
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ console.log('App EXISTS');
const Input = require('./lib/input.js');
const Notes = require('./lib/notes.js');

let parsed = new Input(process.argv.slice(2));
let notes = new Notes(parsed);

//let notes = new Notes(parsed);

17 changes: 16 additions & 1 deletion lib/input.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
'use strict';

const minimist = require('minimist');
const minimist = require('minimist');

const args = minimist(process.argv.slice(2));
console.log(args);
let action = (Object.keys(args).slice(1).toString());
console.log(action);

class Input {
constructor(args, action) {
this.action = action;
this.payload = args.a;
}
}

console.log(new Input(args, action));
module.exports = Input;
29 changes: 29 additions & 0 deletions lib/notes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict';

class Notes {
constructor(action, payload) {
this.action = action;
this.payload = payload;
this.id = Math.floor(Math.random()*1000);
}

execute() {
const action = ['add', 'a'];
switch(action.includes(this.action)) {
case 'add' || 'a':
Notes.add;
break;

}
}

add() {
let note = new Notes(this.action, this.payload);
return note;
}
}


console.log(new Notes('add', 'testing'));

module.exports = Notes;