isaacs
bbffd9e502
Close #983 Better JSON.parse error detection
Previous pattern would only catch ILLEGAL, not { or other
known-but-unexpected JSON tokens.
14 years ago
Tim Baumann
6c7c4aeab6
Don't overwrite an user-specified repl.writer
14 years ago
Wade Simmons
d00739ce56
make it possible to do repl.start('', stream)
14 years ago
Ryan Dahl
55048cdf79
Update copyright headers
14 years ago
isaacs
a48f73d0d3
Closes GH-232 Make the repl's global the right thing
14 years ago
isaacs
2cfe7b847d
Closes GH-184 Clear require cache on repl .clear
14 years ago
isaacs
f07041e6cd
Make the repl respect node_modules folders.
This is important so that in the future, this will work:
$ cd ~/dev/js/some-project
$ npm install redis
$ node
> require.resolve('redis')
'/Users/isaacs/dev/js/some-project/node_modules/redis/index.js'
14 years ago
Ryan Dahl
192d2e0803
REPL: disable colors in windows for now
14 years ago
Ryan Dahl
9e976abad9
lint
14 years ago
Ryan Dahl
ba80d4d8a9
Transfer data gathering responsibility to readline
Fixes non-raw REPL/Debugger on Posix.
14 years ago
Bert Belder
4475b76535
Readline: use symbolic key names instead of ascii control codes
14 years ago
Ryan Dahl
5a05992155
Lint
14 years ago
Bert Belder
1ac133ea6f
Replace string magic + path.join by path.resolve
Because path.resolve is more elegant and windows-safe.
14 years ago
Ryan Dahl
b6dafc1a47
Allow for two streams in REPL
Towards windows compatibility.
14 years ago
Ryan Dahl
feb77eab65
Fix REPL for named functions
add some tests.
14 years ago
Ryan Dahl
c82fe30ca1
repl.js style
14 years ago
Ryan Dahl
00974df3e5
Allow for evaling statements in REPL too
14 years ago
Ryan Dahl
b45698e676
Improve how REPL commands are evaled
Before:
> {a: 1}
1
> (function() {
... // foo
... return 1;
... })();
...
Now:
> {a: 1}
{ a : 1 }
> (function() {
... // foo
... return 1;
... })();
1
>
14 years ago
Brian White
6d75c06e64
Add os module to repl's built-in lib list
14 years ago
Brian White
e41e078159
Make sure REPL doesn't get borked when invalid REPL keywords are entered
14 years ago
Ryan Dahl
e232f6e735
more lint
14 years ago
Marco Rogers
118b88e44f
update repl to distinguish JSON.parse SyntaxErrors from the rest
14 years ago
Brian White
5908bdab9a
Make sure raw mode is disabled when exiting a terminal-based REPL.
14 years ago
Ryan Dahl
8e09b1e2e1
Simplify REPL displayPrompt
Now that we insert \r into the stream and aren't switching back and forth
between termios modes, not need to worry about when to display the prompt.
14 years ago
isaacs
bfc6b51d95
The cwdRequire hack is no longer necessary with the require.resolve refactor.
14 years ago
isaacs
226eff5104
Add require.resolve.
Also, hack the repl so that it works as expected there, too.
14 years ago
Sami Samhuri
56df0cbf93
new api for defining repl commands
14 years ago
Micheil Smith
e38eb0c5a4
Soft migration of sys -> util, Removal of deprecated utils module.
14 years ago
Ryan Dahl
783f5019b0
Add flag to disable colors in REPL
14 years ago
Sean Coates
ae87007478
add $ to variable name character matching patterns in repl completer
14 years ago
Joshaven Potter
3d4e4d8909
syntax fixes to pass jslint
14 years ago
Ryan Dahl
5829716649
Fix REPL crash on tabbing 'this.'
Thanks to Tim Becker for pointing this out.
14 years ago
Ryan Dahl
d2de8ba400
^c to get out of '...' in REPL
14 years ago
Ryan Dahl
42eb5a6898
Simplify REPL
14 years ago
Trent Mick
1d961a6630
add ANSI coloring option to sys.inspect and, by default, to the repl
15 years ago
Trent Mick
293809b8b6
drop obsolete TODO comment
15 years ago
Trent Mick
5c1ffa165f
repl completion: completion for arguments to "require"
15 years ago
Trent Mick
2134982ea4
repl completion: comment/TODO cleanup, no functional change
15 years ago
Trent Mick
1c9a85b9a6
First pass at tab-completion in the REPL
15 years ago
Blake Mizerany
8c8534046c
fix whitespace errors
15 years ago
Ruben Rodriguez
242161bef2
Added new API to Script, and implemented it in the REPL
15 years ago
isaacs
e65e6039a8
Fix #169 . Expose require members in the repl.
This fixes #169 by putting the require members onto the cwdRequire function
which is exposed to the repl scope.
15 years ago
Ryan Dahl
adc06dd705
Add NODE_NO_READLINE check for REPL
Setting this environmental variable to a non-zero integer will start all
REPL interfaces without readline. For use with rlwrap.
15 years ago
Ryan Dahl
a6942b345d
Fix test-repl
15 years ago
Matt Ranney
09af242c89
Support more readline navigation keys.
15 years ago
Ryan Dahl
41f213be18
Add binding to termios, implement readline for repl
15 years ago
isaacs
a26f7d753d
Make require() from the repl be relative to cwd
15 years ago
isaacs
82813f2f8c
Execute repl code in new context
15 years ago
Ryan Dahl
e97a481785
Destroy REPL pipes instead of shutting down.
15 years ago
Matt Ranney
39464b498f
Add docs for new REPL options and fill out description of commands.
15 years ago