UNPKG
express-di
Version:
latest (5.0.0)
5.0.0
4.1.1
4.1.0
4.0.0
3.0.0
0.1.3
0.1.2
0.1.0
0.0.9
0.0.7
0.0.4
0.0.2
0.0.1
0.0.0
Bring the dependency injection pattern to the Express
github.com/luin/express-di
luin/express-di
express-di
/
benchmarks
/
mock_db.js
11 lines
(9 loc)
•
177 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
var
db = {
1
:
'Bob'
};
var
n =
parseInt
(process.
env
.
DL
||
'1'
,
10
);
exports
.
find
=
function
(
id, callback
) {
setTimeout
(
function
(
) {
callback
(
null
, db[id]); }, n); };