UNPKG
juanhiennvdm_math_example
Version:
latest (1.0.0)
1.0.0
0.1.0
0.0.3
0.0.2
0.0.1
An example of creating a package
juanhiennvdm_math_example
/
lib
/
simple_math.js
18 lines
(13 loc)
•
266 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var
call_counter =
require
(
'./call_counter.js'
);
function
add
(
x, y
) {
call_counter
();
return
x + y; };
function
subtract
(
x, y
) {
call_counter
();
return
x - y; };
module
.
exports
= {
addition
: add,
subtraction
: subtract };