victorb / trymodule

➰ It's never been easier to try nodejs modules!
1.14k stars 29 forks source link

use a different variable name for lodash in readme example #23

Closed zeke closed 8 years ago

zeke commented 8 years ago

Using _ doesn't work on newer versions of node. See https://github.com/nodejs/node/issues/5431

❯ node -v   
v6.4.0

~/Desktop master*
❯ trymodule lodash=_
Gonna start a REPL with packages installed and loaded for you
'lodash' was already installed since before!
Package 'lodash' was loaded and assigned to '_' in the current scope
REPL started...
> Expression assignment to _ now disabled.
shockey commented 8 years ago

Thanks @zeke! Good catch 😄

(cc: #22)

chocolateboy commented 7 years ago

FYI, it still works:

$ node -v
v6.4.0

# ...

REPL started...
> Expression assignment to _ now disabled.
> _.each
[Function: forEach]

The wording is misleading. It doesn't mean "Node.js no longer allows to be assigned to in the REPL" (i.e. is read-only). It means "Expressions entered in the REPL in this session will no longer be assigned to _" (i.e. it's yours now, so don't expect it to contain the result of the last expression you entered).