Как включить модуль в пользовательский Node Repl? - PullRequest
0 голосов
/ 24 марта 2020

Как получить доступ к экземпляру модуля в Node repl?

Например ..

custom-repl.js

const repl = require('repl');
const Redis = require("ioredis");
const redis = new Redis();
console.log('starting Redis Repl');

repl.start('> ', {redis: redis});
chmod +x custom-repl.js
./custom-repl.js

это не не работает ..

> redis.get('foo')
...