Toggle navigation
Toggle navigation
This project
Loading...
Sign in
I_Jemin
/
Node-Study
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
I_Jemin
2018-03-20 07:03:52 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f11a1d40097e63e5ef98c68f8b2187b7276e174d
f11a1d40
1 parent
0b76ffe6
Loading a Module
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
app.js
logger.js
app.js
View file @
f11a1d4
1
-
console
.
log
(
module
);
// module is not global
...
\ No newline at end of file
...
\ No newline at end of file
1
+
var
logger
=
require
(
'./logger'
)
2
+
3
+
logger
.
log
(
'message'
);
...
\ No newline at end of file
...
\ No newline at end of file
...
...
logger.js
0 → 100644
View file @
f11a1d4
1
+
var
url
=
'http://mylogger.io/log'
;
2
+
3
+
function
log
(
message
)
{
4
+
// Send an HTTP request
5
+
console
.
log
(
message
);
6
+
}
7
+
8
+
module
.
exports
.
log
=
log
;
...
\ No newline at end of file
...
\ No newline at end of file
Please
register
or
login
to post a comment