REPL and Node

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

REPL and Node

laurent laffont
Hi,

I'm starting to play with REPL.  How can I use http://nodejs.org/docs/v0.3.1/api/fs.html (and other nodejs stuff) ?  

Laurent
Reply | Threaded
Open this post in threaded view
|

Re: REPL and Node

gokr
On 02/02/2012 08:51 AM, laurent laffont wrote:
> Hi,
>
> I'm starting to play with REPL.  How can I use
> http://nodejs.org/docs/v0.3.1/api/fs.html (and other nodejs stuff) ?

Did you look at the nodejs examples under examples/nodejs?

trivialserver shows how to do require etc.

regards, Göran
Reply | Threaded
Open this post in threaded view
|

Re: REPL and Node

laurent laffont
Thanks Goran ! So I answer myself:

fs := require value: 'fs'.
fs readdir: '/tmp' do: [:anError :aFileName| console log: aFileName].

:)

Laurent 

2012/2/2 Göran Krampe <[hidden email]>
On 02/02/2012 08:51 AM, laurent laffont wrote:
Hi,

I'm starting to play with REPL.  How can I use
http://nodejs.org/docs/v0.3.1/api/fs.html (and other nodejs stuff) ?

Did you look at the nodejs examples under examples/nodejs?

trivialserver shows how to do require etc.

regards, Göran

Reply | Threaded
Open this post in threaded view
|

Re: REPL and Node

laurent laffont
Seriously, that's awesome........

Laurent

On Thu, Feb 2, 2012 at 9:11 AM, laurent laffont <[hidden email]> wrote:
Thanks Goran ! So I answer myself:

fs := require value: 'fs'.
fs readdir: '/tmp' do: [:anError :aFileName| console log: aFileName].

:)

Laurent 


2012/2/2 Göran Krampe <[hidden email]>
On 02/02/2012 08:51 AM, laurent laffont wrote:
Hi,

I'm starting to play with REPL.  How can I use
http://nodejs.org/docs/v0.3.1/api/fs.html (and other nodejs stuff) ?

Did you look at the nodejs examples under examples/nodejs?

trivialserver shows how to do require etc.

regards, Göran


Reply | Threaded
Open this post in threaded view
|

Re: REPL and Node

Nicolas Petton
On Thu, 2012-02-02 at 10:03 +0100, laurent laffont wrote:
> Seriously, that's awesome........

:) I wrote a REPL for Amber on top of nodejs:

./bin/amber

the code is here:
https://github.com/NicolasPetton/amber/blob/master/repl/REPL.st

Cheers,
Nico

>
>
> Laurent
>
> On Thu, Feb 2, 2012 at 9:11 AM, laurent laffont
> <[hidden email]> wrote:
>         Thanks Goran ! So I answer myself:
>        
>        
>         fs := require value: 'fs'.
>         fs readdir: '/tmp' do: [:anError :aFileName| console log:
>         aFileName].
>        
>        
>         :)
>        
>        
>         Laurent
>        
>        
>        
>        
>         2012/2/2 Göran Krampe <[hidden email]>
>                
>                 On 02/02/2012 08:51 AM, laurent laffont wrote:
>                         Hi,
>                        
>                         I'm starting to play with REPL.  How can I use
>                         http://nodejs.org/docs/v0.3.1/api/fs.html (and
>                         other nodejs stuff) ?
>                
>                
>                 Did you look at the nodejs examples under
>                 examples/nodejs?
>                
>                 trivialserver shows how to do require etc.
>                
>                 regards, Göran
>        
>        
>
>