Skip to content

Commit df416ed

Browse files
committed
More Node.
1 parent e43db6d commit df416ed

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Node.js/008_NodeJs/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// To import use require and store in local variable
2+
// ./ means current directory
3+
var movies = require('./movies');
4+
movies.avatar();

Node.js/008_NodeJs/movies.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//Usually want to break up code into different files to better organize
2+
//All movie related code can go here
3+
//Other files can include this code
4+
function printAvatar(){
5+
console.log("Avatar: PG-13");
6+
}
7+
8+
function printChappie(){
9+
console.log("Chappie: R");
10+
}
11+
12+
//What gets exported is determined by 'module.exports' variable
13+
module.exports.avatar = printAvatar;

0 commit comments

Comments
 (0)