Re: [nodejs] Re: trying to wrap my head around "promises" - async vs Q

2012-11-12 Thread Andy
One of them problems even with this approach is that you write and read code backwards. It executes bottom to top because you have to define named callback functions first. I find it much more natural with promises because not only is your code organized, but it reads top to bottom and is MUCH

Re: [nodejs] Re: trying to wrap my head around "promises" - async vs Q

2012-11-12 Thread Andy
On Sunday, November 11, 2012 10:46:05 PM UTC-8, Mikeal Rogers wrote: > > > Some people clearly like promises, but the dominant pattern in node is not > promises, it's callbacks, with complex callback issues managed with async. > > Stating your opinion strongly does not make it a fact. This is you

Re: [nodejs] Re: trying to wrap my head around "promises" - async vs Q

2012-11-12 Thread Andy
> > In JavaScript the order you define things doesn't matter. > It does if your function declaration style is var funcName = function() { }; which is the style I use. Personal preference obviously. > > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node

[nodejs] Having trouble replicating with npm repo (couchdb) - anyone tried it lately and/or seen this error?

2013-05-13 Thread andy
4da753832d`, to target database `registry`. Error: `unauthorized`, reason: `Please log in before writing to the db`. Any ideas? Thanks, Andy -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this mes

[nodejs] Re: How do you handle if/else with async inside

2012-08-07 Thread Andy
I would personally go with using promises. var q = require('q'); q.ncall(function() { if(cond) { return async1(); // this is a promise } return async2(); // so is this }).then(function(res) { // hooray! one of them finished }).error(function(res) { // something went wron

Re: [nodejs] Wind.js : An elegant approach to asynchronies JavaScript

2012-08-23 Thread Andy
yeah, google groups can get a bit annoying at times Regarding *eval*, I'm pretty wary of running your entire async code through it as a string. During this talk on v8 internals at JSConf US, this Russian v8 developer with a long name t

[nodejs] Re: trying to wrap my head around "promises" - async vs Q

2012-11-11 Thread Andy
To reply to my own very old thread after getting some solid experiences with promises, the answers to my questions are: 1. *async* is a library that passes callbacks around. it's ugly and it sucks. 2. a* promise *is just an object. Don't let anyone tell you differently, they are just trying to

[nodejs] Re: how to write for-each loop in JavaScript properly

2012-02-12 Thread Andy
Most of you probably know this, but sometimes I encounter modules that don't do this. And they do unexpected errors. Now that you've discovered Crockford, you should discover when to ignore crockford -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wi

[nodejs] Re: PHP v8 (a little off topic, but you'se are the best guys I know)

2012-03-15 Thread Andy
does anything else think it's terrible that integration with v8 made it into the CORE of php? -- 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 "

[nodejs] Re: how to avoid a call back in this case?

2012-03-19 Thread Andy
But isn't it a big hassle when you have a function that calls a function, and maybe those functions call 5 more functions, and only the deepest one needs a callback, so now the 5 functions above it, even though not doing any asynchronous work, need callbacks as well? -- Job Board: http://jobs.

Re: [nodejs] getting key/value pair from json object

2012-03-22 Thread Andy
node > var a = {node: 1, cow: {moo: 'barf'}}; > require('sys').inspect(a); '{ node: 1, cow: { moo: \'barf\' } }' sys.inspect probably is all you ever need. Also, my logger library does auto object inspecting on log, which I find pretty handy. https://github.com/DelvarWorld/Simple-Node-Logger --

[nodejs] trying to wrap my head around "promises" - async vs Q

2012-03-25 Thread Andy
*Note, I am not asking which tool is better, I am simply trying to understand the differences. *I'm trying to wrap my head around promises in node. Right now I'm writing all my code in callback soup. I am researching libraries and I found async(duh) but I also f

[nodejs] Re: How to avoid callback hell?

2012-04-09 Thread Andy
promises to the rescue! no need to worry. just play it cool. Don't let those callbacks and error passing get you down! B) var q = require('q'); // ncall takes the function, the scope, then optional arguments q.ncall(db.open, db) .then(func

[nodejs] Re: How to avoid callback hell?

2012-04-09 Thread Andy
*Callbacks are silly. Callbacks are bad! Just play it cool, there's fun to be had! If your code is private, if it's no API, use promises my friend! You'll soon see why! Tired of error passing? Tired of nests? With deferred functions, you will have no stress!*

[nodejs] Re: A Framework Author Throwdown

2012-04-19 Thread Andy
nodeup is nodedown? -- 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 "nodejs" group. To post to this group, send email to nodejs@googlegroups.com

[nodejs] How can I distribute my own node.js module using npm?

2012-12-17 Thread Andy Green
Is there any way to distribute node.js modules using npm? If I created a .js file called my-custom-module.js, how could I allow other users to install it using the command "sudo npm install my-custom-module"? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/n

[nodejs] Find location of module folder

2012-12-20 Thread Andy Green
I'm trying to write a script that prints the name of all installed modules to the command line. In node.js, is there any way to find the location of the module folder (with globally installed modules?) -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wik

[nodejs] Re: Find location of module folder

2012-12-20 Thread Andy Green
I've found the answer already: http://stackoverflow.com/questions/13981938/print-all-available-node-js-modules/13982458#13982458 On Thursday, December 20, 2012 7:03:08 PM UTC-5, Andy Green wrote: > > I'm trying to write a script that prints the name of all installed modules

[nodejs] Need an "offline" npm-style repository - what's a good approach?

2013-02-18 Thread andy e
pos...etc. (Right now I just have a "node_modules_for_work" folder where I load up a ton of modules, then I zip that up and bring it in.) I'm happy to go off and do some reading/digging, so links to similar ideas/attempts are appreciated. Thanks, Andy -- -- Job Board: http://jobs.nodejs.org/ Postin

Re: [nodejs] Need an "offline" npm-style repository - what's a good approach?

2013-02-18 Thread andy e
Cool, thanks for the suggestion(s). Two quick questions: 1) Can anyone replicate w/ the npm couch repo? I take it that's a yes but maybe you need permission (then again maybe people are smart enough to not want to have to do this, unlike us...) 2) How big? 10GB? 100GB? 1TB+? Thanks, And

Re: [nodejs] Need an "offline" npm-style repository - what's a good approach?

2013-02-18 Thread andy e
OK, great, thanks for the info. I'll chat it over and maybe give a shot at replicating the couch instance. Thanks for the help! Andy On Mon, Feb 18, 2013 at 12:08 PM, Bradley Meck wrote: > Right now without compaction you are looking at 45~ GB of data it looks > like on the current

Re: [nodejs] Need an "offline" npm-style repository - what's a good approach?

2013-02-18 Thread andy e
in a few bucks to support it. :) andy On Mon, Feb 18, 2013 at 1:10 PM, nwhite wrote: > I wish it was trivial to have a sparse npm server. One where I could > publish my private modules to and replicate only the packages I'm > interested in. Then have all npm package requests that

Re: [nodejs] Need an "offline" npm-style repository - what's a good approach?

2013-02-19 Thread Andy Ennamorato
Wow, that link is awesome. Thank you. Andy Sent from my iPhone On Feb 19, 2013, at 1:56 AM, Floby wrote: > You can set up a npm repository of your own pretty easily [1]. It doesn't > have to replicate the public npm repository. > I don't know how hard it would be to patc

Re: [nodejs] Node.js VS Scala VS Clojure: what for an API with a we-love-java-we-dont-even-know-why business component in the company?

2013-02-26 Thread andy e
-2013, specifically the slides on Aggregation and Spindrift. andy On Tue, Feb 26, 2013 at 2:28 PM, andreacode wrote: > Hi everybody! > > I need some help on getting together as much information as possible on > node.js (and its competitors), as we're going to start a quite project

[nodejs] Anyone using Vagrant for, say, testing with multiple browsers or as a type of CI server?

2013-02-26 Thread andy e
o gather 'em up. Thanks! Andy -- -- 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 "nodejs" group. To post to this group, send email

Re: [nodejs] Anyone using Vagrant for, say, testing with multiple browsers or as a type of CI server?

2013-02-27 Thread Andy Ennamorato
Very cool. Thanks for the tip/link! Andy Sent from my iPhone On Feb 27, 2013, at 2:03 PM, Tauren Mills wrote: > We are using vagrant, but I didn't do any of the setup so can't provide much > insight. But if you need to test IE environments, we've found this project is

Re: [nodejs] Anyone using Vagrant for, say, testing with multiple browsers or as a type of CI server?

2013-02-27 Thread Andy Ennamorato
I saw an issue with symlinks too but that script looks pretty handy. Thanks for the links/feedback! Andy Sent from my iPhone On Feb 27, 2013, at 10:19 AM, Jacob Groundwater wrote: > We use Vagrant sometimes, but it can take a while to find the workflow that > works best for you. >

Re: [nodejs] options for private npm registries?

2013-05-01 Thread andy e
ncy in any package.json's of other modules I'm depending upon) but might end up working for us in our bizarro environment. andy On Wed, May 1, 2013 at 3:58 PM, Laurie wrote: > Hi, I'm looking into the options for setting up a private npm repository > and the trade-offs in terms of

Re: [nodejs] Node v0.11.2 (Unstable)

2013-05-14 Thread Andy Wingo
.19.1 to try out generators in anger. Regards, Andy -- -- 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 "nodejs" group. To post to thi

Re: [nodejs] Re: Having trouble replicating with npm repo (couchdb) - anyone tried it lately and/or seen this error?

2013-05-16 Thread andy e
e-repositories/) and someone will create an 'enterprise' repo a la Nexus/Artifactory. andy On Thu, May 16, 2013 at 6:50 PM, Kevin Sawicki wrote: > Hi Andy, > > I'm also seeing the exact same issue trying to replicate > isaacs.iriscouch.com to another iriscouch.com data

Re: [nodejs] Re: Having trouble replicating with npm repo (couchdb) - anyone tried it lately and/or seen this error?

2013-05-18 Thread Andy Ennamorato
y or Nexus in Java land) but I hadn't really seen anything like that. Ill have to check out shadow-npm. Andy > > On Tuesday, May 14, 2013 7:16:51 AM UTC+4, andy wrote: >> >> Based on the awesome feedback I got from >> https://groups.google.com/d/msg/nodejs/sX4mbsRPwl

Re: [nodejs] product roadmap?

2013-05-21 Thread Andy Ennamorato
There's a webinar/online conf about that in 45mins or so: http://nodestack.org/ Andy Sent from my iPhone On May 20, 2013, at 7:42 PM, Gowrishankar Holalkere wrote: > Has Joyent or node team announced their product roadmap? Is it something they > have talked about at any forums?

Re: [nodejs] Re: Having trouble replicating with npm repo (couchdb) - anyone tried it lately and/or seen this error?

2013-05-23 Thread andy e
name dropping that hoping he'll appear out of thin air with a bunch of commits that finish it up :) ), maybe that can be of some use. I'll definitely keep my eye on your repo and maybe I can help out at some point. andy On Wed, May 22, 2013 at 9:04 AM, Alex Kocharin wrote: > Andy, &

Re: [nodejs] Re: Having trouble replicating with npm repo (couchdb) - anyone tried it lately and/or seen this error?

2013-05-24 Thread andy e
Joshwa, Cool, thanks for the tip. Were you running Couch 1.2 or 1.3? We still need to try a few of these suggestions (guy doing most of this has been out for a week) but will definitely give this a shot. Thanks! Andy On Thu, May 23, 2013 at 11:53 PM, Joshwa Fugett wrote: > Give this on

Re: [nodejs] Re: Best practices for token-based authentication in REST API

2013-05-29 Thread Andy Ennamorato
What about Persona (browserid) from Mozilla? I know it's a little off the mark but maybe it's useful as an example - https://github.com/mozilla/browserid Interested to see what you come up with at any rate. Andy Sent from my iPhone On May 29, 2013, at 6:50 AM, Alan Fay wrote: &g

Re: [nodejs] Re: Having trouble replicating with npm repo (couchdb) - anyone tried it lately and/or seen this error?

2013-06-11 Thread Andy Ennamorato
package up and I'm sure there will be more questions along the way. Big thanks to all the suggestions and help its much appreciated (and if you ever come to Denver or the DenverJS meetup ill buy you a beer or three). Andy Sent from my iPhone On Jun 11, 2013, at 2:18 AM, Erdem Agaoglu

[nodejs] Problems and Questions about replica npm repo on private network

2013-07-10 Thread andy e
e64/Base64-0.1.2.tar.gz, the file is there and is valid. It's like our redirects don't work/resolve. Any ideas? When I dig around in the couchapp (~/_utils) everything looks to be there. This happens with all dep's, not just Base64 of course. thanks, andy -- -- Job Board: http://j

[nodejs] Best practice for Node module interface

2013-07-11 Thread Andy W.
I have seen a wide variety in different style for creating custom Node modules. What style do you prefer or are there any best practices? I'm fairly new to the Node community. var module = require('module'); // A var foo = new module.Foo(); // B var foo = module.foo(); // C var foo = module.c

[nodejs] Re: Problems and Questions about replica npm repo on private network

2013-07-15 Thread andy e
on running your own replica (and eventually, something like Artifactory?) the better. andy On Thu, Jul 11, 2013 at 12:45 AM, andy e wrote: > After a lot of good advice in here, we eventually replicated a copy of the > npm repo (using couch 1.2.x and Windows - go figure). > > We f

[nodejs] Node.JS in the DoD

2013-07-16 Thread andy e
Anyone know of any uses of Node.js within the DoD (or other secure/federal gov't environments)? Feel free to ping me off list if so. Some folks are looking for help getting approvals and pointing to existing instances/uses can help. andy -- -- Job Board: http://jobs.nodejs.org/ Po

Re: [nodejs] local private npm repository

2013-07-31 Thread Andy Ennamorato
b.com/mbrevoort/node-reggie). I'm hopeful that in the near future multiple repos (and npm's ability to use them) becomes a more realistic option. Andy Sent from my iPhone On Jul 31, 2013, at 10:36 AM, Osher El-Netanany wrote: > Hi all, > > 'ok, this is kind'a emb

[nodejs] Dependencies for native module installs via npm/node-gyp (especially when offline)

2013-08-12 Thread andy e
hat other dependencies it's going to need (obviously the install didn't finish). However, when I try it now on Mac OS X on a connected machine, it works fine and doesn't seem to look for anything on nodejs.org. Is that a Windows only thing? Thanks, Andy -- -- Job Board: http://jobs.nodejs

Re: [nodejs] Dependencies for native module installs via npm/node-gyp (especially when offline)

2013-08-13 Thread Andy Ennamorato
Ben, On Aug 13, 2013, at 1:03 AM, Ben Noordhuis wrote: > On Tue, Aug 13, 2013 at 5:45 AM, andy e wrote: >> When trying to install leveldown/levelup on Windows using node 0.10.9 & npm, >> npm/node-gyp grabs dependencies from http://nodejs.org/dist/> version here>/ >&

Re: [nodejs] Suggestions for alternatives to private npm repos?

2013-08-22 Thread andy e
I think https://github.com/stagas/npm-server might help. And/or node-reggie (https://github.com/mbrevoort/node-reggie - also see http://blog.strongloop.com/deploy-a-private-npm-registry-without-couchdb-or-redis/ ). andy On Thu, Aug 22, 2013 at 4:24 PM, Adam Crabtree wrote: > Though it does

Re: [nodejs] Suggestions for alternatives to private npm repos?

2013-08-23 Thread andy e
Ah, okay. I was thinking you needed the reverse (look in private first, then public). FWIW, support for multiple repositories in npm is apparently coming soon: https://github.com/isaacs/npm/issues/1401#issuecomment-22586377 (which will be awesome) andy On Thu, Aug 22, 2013 at 5:06 PM, Adam

Re: [nodejs] Private registry without full replication

2013-10-11 Thread Andy Ennamorato
node-reggie can do some of this: https://github.com/mbrevoort/node-reggie/ There's some info on how to load with with a "cache" of modules from npm proper in one of the closed issues https://github.com/mbrevoort/node-reggie/issues/9 Andy Sent from my iPhone > On Oct 11

[nodejs] Node DNS test failures?

2013-11-11 Thread Andy C
hints? Is this a known (or expected?) issue? Thanks for any comments, Andy -- -- 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 "nodejs&quo

Re: [nodejs] Node DNS test failures?

2013-11-11 Thread Andy C
f 256 asterisks. Is it possible those tests are relying on the behaviour of a particular libc version/DNS lookup system for a particular failure case? Andy On Monday, 11 November 2013 20:52:13 UTC, Matt Sergeant wrote: > > Any chance you don't have a resolver set up? What'

Re: [nodejs] Node DNS test failures?

2013-11-12 Thread Andy C
Well spotted TC! I guess I won't worry about those particular tests for now. Thanks! Andy On Monday, 11 November 2013 23:29:06 UTC, T.C. Hollingsworth wrote: > > On Mon, Nov 11, 2013 at 3:58 PM, Andy C > > wrote: > > Thanks for the suggestion. > > > > I

[nodejs] test-http-client-parser-double-free.js test failure?

2013-12-10 Thread Andy C
(events.js:120:20) Andy -- -- 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 "nodejs" group. To post to this group, send email

Re: [nodejs] Re: Having trouble replicating with npm repo (couchdb) - anyone tried it lately and/or seen this error?

2014-02-06 Thread andy e
ier to run your own repo and replicate from the main one as well. andy On Thu, Feb 6, 2014 at 6:42 PM, Dmytro Semenov wrote: > Quick update: the _design document has *validate_doc_update *which > validate updates. > By commenting out the following section fixed the issue: > >

[nodejs] Heavy computation best practices

2014-03-16 Thread Andy Zelinski
I am hoping for someone to point me in the right direction (examples, info) on how best to handle the need for some processor heavy computations that might best be executed with C++ math libraries. example scenario pseudocode: 1. application user clicks "give me 10 movies to watch" button after

Re: [nodejs] scripts to initialize MongoDB ??

2014-04-28 Thread andy e
ork or not (I think the answer is yes) but you might be able to email 'em and ask about that. The course covers things like connecting to mongodb from node, running queries/extracting data, etc. andy On Mon, Apr 28, 2014 at 2:11 AM, Dipali Lohar wrote: > I have given a assignment to init

Re: [nodejs] Licensing

2014-11-20 Thread andy e
http://choosealicense.com is a pretty good site, explains some use cases and requirements when picking a license. (I don't know of any license that requires permission to use - seems like usually someone just slaps GPLv2 on things they want 'shared' but not necessarily used/copied.) On Thu, Nov 20

[nodejs] Passing a Buffer from C++ to a callback - object lifetime?

2015-08-13 Thread Andy C
Hi, I am writing a C++ module for node. I have a JS callback registered which will receive regular callbacks with binary data (audio data). My C++ to call the callback looks a bit like: UniquePersistent dataCallback = // from somewhere... HandleScope scope(isolate); const unsigned

[nodejs] Re: Passing a Buffer from C++ to a callback - object lifetime?

2015-08-14 Thread Andy C
ext garbage collection *if there are no > other references to them*. I *think* this means that because fs.writeFile() has a reference to the Buffer, it will not be garbage collected, and the memory held on to. Andy On Thursday, 13 August 2015 23:09:39 UTC+1, Andy C wrote: > > Hi

[nodejs] Re: Passing a Buffer from C++ to a callback - object lifetime?

2015-08-17 Thread Andy C
ted while there is no handle context holding it. > > About the persistent handle, be careful to release it : > http://izs.me/v8-docs/classv8_1_1Persistent.html#a33e53191844272ba0f2da4f55fc12297 > > Loïc > > > Le vendredi 14 août 2015 21:33:24 UTC+8, Andy C a écrit : >> &g