[nodejs] request.js piping w/ autodetect file type

2012-02-09 Thread Alex Topliceanu
Hi, I want to use mikeal's request to stream down large resources from the web. I want to determine automatically the file type csv/json/xml and if it's compressed so i can stream it down to the correct handler. Something like this: var input = request(); var output1 = *(input is gzipped)* ? in

[nodejs] Async Error Handling and Domains

2012-02-09 Thread Brad Carleton
Currently, async error handling in node is difficult. I know that you guys are working hard on domains. Do domains solve some of the problems of async error handling and are they similar to an async try/ catch? There is currently not a lot of documentation, and I would love to get a better under

Re: [nodejs] Re: bundle javascript for reuse in the browser

2012-02-09 Thread Phoscur
Concerning webmake: I see that I can easily implement jslint/hinting with webmake, but I can online parse the concatenated source, getting line numbers out of that file is pretty useless. So I need another hook/event that gets called for each file processed. Also I ran into some dependency resolvi

Re: [nodejs] Re: forking npm modules

2012-02-09 Thread Ruben LZ Tan
Chris just make sure that when you deploy, your git client on your server has access to your repo. We're running our project on hook.io and have one repo per hook to make it easy to isolate the code of each domain, so that model works fine for us. If you have a bunch of modules that doesn't need

Re: [nodejs] Building Node MSI

2012-02-09 Thread Nathan Rajlich
Do let me know which native modules you would like to see supported on Windows and I will give them some priority in sending them appropriate pull requests! On Thu, Feb 9, 2012 at 6:32 PM, C. Mundi wrote: > Very nice. Your node-gyp is really going to help node adoption on > Windows. I just rea

Re: [nodejs] Building Node MSI

2012-02-09 Thread C. Mundi
Very nice. Your node-gyp is really going to help node adoption on Windows. I just read the readme. Some of the modules I use do not yet support gyp (but some appear to be moving in that direction) so I may try my luck at writing some gyp files and contributing if I get them working. Thanks! On

Re: [nodejs] Re: bundle javascript for reuse in the browser

2012-02-09 Thread Phoscur
Looks good! I'll give it a try! Am 10.02.2012 00:21, schrieb Mariusz Nowak: > @Phoscur, give modules-webmake > a try, with plain written > requires it will just work (no matter if it's same or external package > module), it also has the smallest footpri

Re: [nodejs] Checking for memory leaks.

2012-02-09 Thread Mark Hahn
A leaked object is like a weed. A plant is a weed if and only if you don't want it. If your code leaves objects traceable to something permanent then that object is going to stay around. If you want the object some time in the future, it is not a leak. If you will never use it again it is a lea

[nodejs] Checking for memory leaks.

2012-02-09 Thread bradley griffiths
I'm trying to make sure my application doesn't have any memory leaks. Is there any way to do this rather than just monitoring it in production? My test suite pretty much covers the entire application, what about crudely putting it in a loop and running it a few thousand times and checking the m

Re: [nodejs] Re: bundle javascript for reuse in the browser

2012-02-09 Thread Taka Kojima
What Adam says... Loading 190kb of additional JavaScript to be able to call App.init(), just doesn't make sense. I gave an example of loading JS on-demand when needed, but I never really do this. Lazy loading, i.e. loading the rest of the JS that is non-critical to the startup of your application

[nodejs] Re: bundle javascript for reuse in the browser

2012-02-09 Thread Mariusz Nowak
@Phoscur, give modules-webmake a try, with plain written requires it will just work (no matter if it's same or external package module), it also has the smallest footprint from all similar tools I know. At this moment it won't jslint or minify your fi

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Adam Crabtree
The main issue here is that we need to stop viewing IO in the browser as equivalent module loading. IO in the browser is more along the lines of installation. Doing an asynchronous require in the browser, is more akin to: require('child_process').exec('npm install moduleA', function(err) { var m

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Phoscur
Then it depends on what you want to build. I want a fat client WebApplication. Maybe you don't want 200kb JavaScript on your frontpage. But for the WebApplication I trade small loads on each click against a longer loading time on initialisation. Am 09.02.2012 23:45, schrieb Taka Kojima: > I under

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Taka Kojima
I understand how browserify works, maybe I didn't clarify well enough. Yes, you don't have to inject moduleZ into moduleA, B and C if you put them all in the same file and load that js file upfront. This is not scalable though. If my entire site has 200kb of JS throughout the entire site, requiri

[nodejs] Re: forking npm modules

2012-02-09 Thread Chris Scribner
Interesting discussion about the move from npm to checking in modules. At my workplace we went the opposite direction :) We aren't using a private npm repository though... I don't think that would be worth it for our case. This particular question is about an open source module, though. I'm going

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Phoscur
I think you haven't actually understood how browserify/browserbuild work: 1. load source files 2. wrap a function around them 3. concat all of them together and add a custom require() emulating node's require 4. instead of many script tags, insert one with the big file Now when moduleA requires mo

[nodejs] Re: Help with Formidable

2012-02-09 Thread tjholowaychuk
if you're using bodyParser read the bottom of this: http://www.senchalabs.org/connect/middleware-bodyParser.html it will otherwise handle multipart for you On Feb 9, 12:08 pm, Phil Daws wrote: > I have studied the example upload.js and change my code slightly based on > that but it still just ha

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Taka Kojima
It's not really AJAX, it's just loading in the js files by injecting

Re: [nodejs] Building Node MSI

2012-02-09 Thread C. Mundi
Hi Nathan, That's great! I will try it out (probably over the weekend) and let you know how it goes. I do like the idea of being able to build the MSI, but that can wait. Thanks! On Feb 9, 2012 2:27 PM, "Nathan Rajlich" wrote: > You don't actually need to compile node yourself to compile nati

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Phoscur
Then do not load code via ajax. Am 09.02.2012 22:18, schrieb Mark Hahn: > > What exactly the problem with using node's synchronous approach in > the browser? > > Node loads the module quickly from the disk. Loading over an ajax > request is much slower. > > -- > Job Board: http://jobs.nodejs.

Re: [nodejs] Building Node MSI

2012-02-09 Thread Nathan Rajlich
You don't actually need to compile node yourself to compile native modules, just use node-gyp: https://github.com/TooTallNate/node-gyp The reason you don't need to compile node manually is that node-gyp downloads the required node.lib file from Joyent's servers, all you need to do is specify the t

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Mark Hahn
> What exactly the problem with using node's synchronous approach in the browser? Node loads the module quickly from the disk. Loading over an ajax request is much slower. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidel

Re: [nodejs] Re: V8 script contexts created through the vm module

2012-02-09 Thread Ben Noordhuis
On Thu, Feb 9, 2012 at 19:01, Tomasz Janczuk wrote: > Thanks for detailed answers. > > Re: 3. I notice an [undocumented] process.uvCounters() function. It > looks potentially interesting. What exactly does it do? It's less interesting than it looks: it's a debugging tool, a counter of the number

[nodejs] Re: options.fd in fs.createReadStream

2012-02-09 Thread NodeJazz
> Yes. However, there is a bug in node < 0.7.3 where the stream won't > start until you call stream._read(). It's fixed in f64989e: > Thanks for the clarification. I think I just bumped into this bug. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/w

Re: [nodejs] options.fd in fs.createReadStream

2012-02-09 Thread Ben Noordhuis
On Thu, Feb 9, 2012 at 18:07, NodeJazz wrote: > What is the use of the 'fd' property of the 'options' parameter of the > method fs.createReadStream? Can it be used to create a stream from a fd that > is already available (obtained via fs.open callback)? eg > >             var options = {}; >      

Re: [nodejs] options.fd in fs.createReadStream

2012-02-09 Thread Isaac Schlueter
Yes, that is what it's for. I think you still might need to pass in a path, but maybe that's been fixed. It's very rare that you should need to do this. Most of the time, you just open the file for the stream. On Thu, Feb 9, 2012 at 09:07, NodeJazz wrote: > What is the use of the 'fd' property

[nodejs] Building Node MSI

2012-02-09 Thread C. Mundi
Hi. I choose to build node because I need to build native modules against it. I have built node 0.6.10 for Windows and I would like to wrap it up in an MSI for convenient repeatable deployment. So I installed WiX 3.5 and did this: C:\node-v0.6.10> vcbuild.bat release msi and what I get is C:\

Re: [nodejs] Help with Formidable

2012-02-09 Thread Phil Daws
I have studied the example upload.js and change my code slightly based on that but it still just hangs when I post :( If I try the example code that works fine. Must be missing something silly :( app.get('/upload', routes.upload); app.post('/upload', function(request, response) { var form =

Re: [nodejs] Re: node 0.6.10 Windows Build Failure

2012-02-09 Thread C. Mundi
My workaround right now is just to build in a path with no spaces. :) On Thu, Feb 9, 2012 at 12:54 PM, C. Mundi wrote: > Building with 'nosnapshot' appears to work. That's not ideal. I will > pass a bug report up to Google V8 and see what happens if I can't fix the > problem first. > > > On T

Re: [nodejs] Re: node 0.6.10 Windows Build Failure

2012-02-09 Thread C. Mundi
Building with 'nosnapshot' appears to work. That's not ideal. I will pass a bug report up to Google V8 and see what happens if I can't fix the problem first. On Thu, Feb 9, 2012 at 12:47 PM, C. Mundi wrote: > It's almost like whoever created this was working under Cygwin or so shell > other th

Re: [nodejs] Re: node 0.6.10 Windows Build Failure

2012-02-09 Thread C. Mundi
It's almost like whoever created this was working under Cygwin or so shell other than the "Visual Studio Command Prompt" shell. Whatever the problem is, it is new since the node 0.6.7 or 0.6.8 tarballs. I am really hoping it's not upstream... but I agree it looks that way at first glance. I'd be

Re: [nodejs] Re: node 0.6.10 Windows Build Failure

2012-02-09 Thread Nathan Rajlich
Yes that is indeed a problem handling spaces. I think a fix would be sweet too but I think it's an issue with V8's build system actually. On Thu, Feb 9, 2012 at 11:38 AM, C. Mundi wrote: > > I forgot to mention... it looks like it might be a simple matter of > escaping spaces in windows pathname

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Taka Kojima
I should have lead with the first paragraph, I realize this doesn't solve any of your needs/requirements, Mainly I was just trying to say (with a shameless self-plug) that trying to get node modules to work in the browser, is not the right approach. It should be getting browser modules to work in

[nodejs] Re: node 0.6.10 Windows Build Failure

2012-02-09 Thread C. Mundi
I forgot to mention... it looks like it might be a simple matter of escaping spaces in windows pathnames. But output from #$@& Microsoft build tools does nto make it easy to figure out where to look. On Thu, Feb 9, 2012 at 12:30 PM, C. Mundi wrote: > C:\> vcbuild.bat release > > ... compilatio

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Taka Kojima
I wrote a library for this. It's small (3.8kb) and has a cli for building. http://www.screenr.com/wOas https://github.com/gigafied/minion It allows you to develop locally without having to build every time you make changes, it handles the dependency loading asynchronously. When you are ready to

[nodejs] node 0.6.10 Windows Build Failure

2012-02-09 Thread C. Mundi
C:\> vcbuild.bat release ... compilation looks good apart from "harmless" warnings ... Finished generating code mksnapshot.vcxproj -> C:\Documents and Settings\kferrio\My Documents\Downloads\node-v0.6.10\Release\mksnapshot.exe run_mksnapshot 'C:\Documents' is not recognized as an internal

Re: [nodejs] bundle javascript for reuse in the browser

2012-02-09 Thread Adam Crabtree
Honestly, all browser-side modules should adhere whether initially or through a build process to the AMD pattern as this is where the current momentum is and it is a module definition pattern first and foremost built for the browser environment. Also, this pattern is very compatible with node modul

[nodejs] Re: forking npm modules

2012-02-09 Thread Marco Rogers
If you're building an app, check in your dependencies. Take npm out of the equation (mostly) :) http://eng.yammer.com/blog/2012/1/4/managing-nodejs-dependencies-and-deployments-at-yammer.html :Marco -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/

Re: [nodejs] forking npm modules

2012-02-09 Thread Ruben Tan
In our company we use this git+ssh://g...@github.com:your-repo... Try googling for private npm module and see. Or check out tis link http://debuggable.com/posts/private-npm-modules:4e68cc7d-1ac4-42d9-995a-343dcbdd56cb Sent from my iPod On 10 Feb 2012, at 02:10, Chris Scribner wrote: > Hi, >

[nodejs] forking npm modules

2012-02-09 Thread Chris Scribner
Hi, I've been using the workflow described at http://www.debuggable.com/posts/how-to-fork-patch-npm-modules:4e2eb9f3-e584-44be-b1a9-3db7cbdd56cb to handle custom modifications to modules published on npm. The basic workflow is to create a fork and set up the package.json to point to the tar.gz of

[nodejs] Re: V8 script contexts created through the vm module

2012-02-09 Thread Tomasz Janczuk
Thanks for detailed answers. Re: 3. I notice an [undocumented] process.uvCounters() function. It looks potentially interesting. What exactly does it do? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received thi

[nodejs] Help with Formidable

2012-02-09 Thread Phil Daws
Hello, I am attempting to write my first app that simply allows a file to be uploaded. When I click on the submit button the browser appears to start to post but just sits there. The app code I am using is: app.post('/upload', function(request, response) { var form = new formidable.Incom

[nodejs] options.fd in fs.createReadStream

2012-02-09 Thread NodeJazz
What is the use of the 'fd' property of the 'options' parameter of the method fs.createReadStream? Can it be used to create a stream from a fd that is already available (obtained via fs.open callback)? eg var options = {}; options.fd = fd; var readStream = fs.

Re: [nodejs] Any Easy-Cheezy-Small-CMS for nodejs?

2012-02-09 Thread Skyler Brungardt
Not yet (but I'll create one and check it in today); you can create one with the users.js file. You'll need to require it in one of the files. I'll have some comments in the code checked in by the end of today that have more info on how to do it, also. -Skyler On Feb 9, 2012, at 10:57 AM

Re: [nodejs] [ANN] NodeJS and NPM without installer for Windows.

2012-02-09 Thread Oliver Leics
> How hard would it be to make this part of the vcbuild.bat file? Quick gist: https://gist.github.com/1780781 Please see the comment on that gist. On Thu, Feb 9, 2012 at 9:20 AM, Oliver Leics wrote: > Hallo Isaac, > >> How hard would it be to make this part of the vcbuild.bat file? > > Not ver

Re: [nodejs] Any Easy-Cheezy-Small-CMS for nodejs?

2012-02-09 Thread Anand George
Thanks Skyer. Is there any default login/password. On Thu, Feb 9, 2012 at 8:48 PM, Skyler Brungardt wrote: > Anand, > > Right now it includes the ability to host multiple sites, based upon > hostname. So until I add a symlink for it, you'll need to add this to your > hosts file (usually in /et

Re: [nodejs] Any Easy-Cheezy-Small-CMS for nodejs?

2012-02-09 Thread Skyler Brungardt
Anand, Right now it includes the ability to host multiple sites, based upon hostname. So until I add a symlink for it, you'll need to add this to your hosts file (usually in /etc/hosts): 127.0.0.1 nooline.org Then when you fire up nooline.org in your browser, it'll point to your local instan

Re: [nodejs] Can you explain the "sendHandle" option in child.send(message, [sendHandle])??

2012-02-09 Thread Ben Noordhuis
On Thu, Feb 9, 2012 at 14:49, Rambo wrote: > I don't get it. What is that for and what kind of data type are we talking > about?  Thanks. It's what the cluster module uses to send TCP and UNIX sockets (the _handle property of net.Server and http.Server objects) to child processes. It's probably n

[nodejs] Can you explain the "sendHandle" option in child.send(message, [sendHandle])??

2012-02-09 Thread Rambo
I don't get it. What is that for and what kind of data type are we talking about? Thanks. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nod

[nodejs] Howto sign into a browser game with openid account?

2012-02-09 Thread dmitry
Hi everyone! I am trying to make a bot for browser game with node.js. I need to login into game main page with login and password from openid account than I will be able to perform game actions by sending post requests to game server. How do I exacty do it? -- Job Board: http://jobs.nodejs.org/ P

[nodejs] Re: Isolates removed

2012-02-09 Thread Liam
Hey Bruno, Perhaps post the API summary, and some example code? You might get some good feedback here as you're polishing it for release... Liam On Feb 8, 7:35 am, Bruno Jouhier wrote: > Hi Liam, > > The project exists but it is just an empty shell. I'm working with > Jorge to package/document

Re: [nodejs] Re: How to continuously read a file while the file is been writing

2012-02-09 Thread Marcel Laverdet
Yeah if the file is being replaced or truncated you will need to handle that differently. The code I posted is fine for the simple case of a unique file being uploaded, but obviously your case may be more complex. This is enough to get you started though! Gambate~ On Wed, Feb 8, 2012 at 10:14 PM,

Re: [nodejs] [ANN] NodeJS and NPM without installer for Windows.

2012-02-09 Thread Oliver Leics
Hallo Isaac, > How hard would it be to make this part of the vcbuild.bat file? Not very, if wget/curl and unzip/7z or any other commandline unzipper and downloader is available on the windows-box running the vcbuild.bat. Both are not shipped with standard windows. > Also, I regularly upload npm