Re: [nodejs] do not use bodyParser with express.js

2013-09-07 Thread Ryan Graham
FWIW, an issue was opened for this 16 days ago: https://github.com/senchalabs/connect/issues/871 ~Ryan On Fri, Sep 6, 2013 at 4:25 PM, Andrew Kelley superjo...@gmail.com wrote: http://andrewkelley.me/post/do-not-use-bodyparser-with-express-js.html in short, every post endpoint in which you

Re: [nodejs] Re: diff between module.exports and exports

2013-10-15 Thread Ryan Graham
This behaviour is documented here: http://nodejs.org/api/modules.html#modules_modules If the explanation there is not clear, do you have any suggestions on how to improve it? Is there another section in the docs that you looked for this information first? Suggestions welcome! ~Ryan On Tue,

Re: [nodejs] Ben Noordhuis's Departure

2013-12-05 Thread Ryan Graham
Thank you for your many contributions, Ben. And thank you for merging my docs pull requests when everyone else was too busy or otherwise unavailable. ~Ryan On Tue, Dec 3, 2013 at 9:36 PM, Isaac Schlueter i...@izs.me wrote: As of this past weekend, Ben Noordhuis has decided to step away from

Re: [nodejs] node 0.11.9 - missing symbols Integer::New, IsRegExp

2014-01-07 Thread Ryan Graham
Related to https://github.com/joyent/node/issues/6801 ? ~Ryan On Tue, Jan 7, 2014 at 2:56 PM, Jerome Wagner aky...@gmail.com wrote: Hello, I hope this is the right place to report this issue. I am trying to work on porting node-sqlite3 to node 0.11.x (specifically 0.11.9 as of now)

Re: [nodejs] Re: Build nodejs with an alternative build system?

2014-03-06 Thread Ryan Graham
On Wed, Mar 5, 2014 at 9:51 AM, Ryan Dahl r...@tinyclouds.org wrote: On Wed, Mar 5, 2014 at 9:42 AM, Kevin Ingwersen ingwie2...@googlemail.com wrote: That I noticed. But isnt it possible to use v8 with autotools or similar - or does it really completely rely on gyp? I myself can't really

Re: [nodejs] Re: Continuous Delivery , Versioning Artefacts with nodejs

2014-03-24 Thread Ryan Graham
On Wed, Mar 19, 2014 at 7:32 AM, Patrick Debois patr...@jedi.be wrote: Hi group, I'd like to get some feedback on the following flow of publishing nodejs apps in a continuous delivery mode: Are you trying to deliver modules? Or deploy applications? It's a bit unclear what your end product

Re: [nodejs] Why is my streaming word counter so much slower than a non streaming version?

2014-04-06 Thread Ryan Graham
On Sat, Apr 5, 2014 at 10:01 PM, Dan Schmidt daniel.adam.schm...@gmail.comwrote: So, I'm trying to use streams more and better understand how to use them properly. There was this little contest over at Treehouse to write an app that would count the words in a text file after being filtered

Re: [nodejs] How to kill callback by timeout?

2014-04-16 Thread Ryan Graham
On Wed, Apr 16, 2014 at 11:17 AM, Alexey Petrushin alexey.petrus...@gmail.com wrote: Is it possible to do something like this? function safeCallToSomeRemoteService(callback){ var remoteServiceResponded = false unsafeCallToSomeRemoteService(function(err, data){

Re: [nodejs] Node v0.10.27 (Stable)

2014-05-01 Thread Ryan Graham
Best to hold off for a few minutes for a re-cut. The bundled version of npm (1.4.8) is broken. ~Ryan On Thu, May 1, 2014 at 4:14 PM, Ben Noordhuis i...@bnoordhuis.nl wrote: On Fri, May 2, 2014 at 12:47 AM, Timothy J Fontaine tjfonta...@gmail.com wrote: 2014.05.01, Version 0.10.27 (Stable)

Re: [nodejs] Memory leak with Buffer.toArrayBuffer

2014-05-12 Thread Ryan Graham
For the curious, the discussion moved to https://github.com/joyent/node/issues/7609 ~Ryan -- http://twitter.com/rmgraham -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules:

Re: [nodejs] Node.js performance tip of the week: scaling apps with nginx, Apache, PM2, node-cluster and clusterctl

2014-05-17 Thread Ryan Graham
On Fri, May 16, 2014 at 10:27 AM, // ravi ravi-li...@g8o.net wrote: is the framework (SL Cluster Management?) that includes the slc commands open source and or Free? The slc command is from the strong-cli package on npm, source here: https://github.com/strongloop/strong-cli `slc run` makes

Re: [nodejs] node.js cluster multiprocess logging solution

2014-06-12 Thread Ryan Graham
You got a lot of feedback and suggestions. What did you end up doing to solve this? ~Ryan On 28 April 2014 03:45, gen chen chengen.h...@gmail.com wrote: I am now working on a node.js project based on cluster. I got stuck on the logging. After doing some research, I worked out a solution.

Re: [nodejs] node.js cluster multiprocess logging solution

2014-06-14 Thread Ryan Graham
That is a very interesting little module. It's a shame that winston is so much slower that the benchmark script is actually annoying to run without omitting it. To make that pain worse, I found a way of significantly speeding up ln. Pull requests welcome? ~Ryan On 13 June 2014 07:26, WooD Fung

Re: [nodejs] Deployment techniques

2014-06-24 Thread Ryan Graham
On Tue, Jun 24, 2014 at 7:00 AM, henrique matias hems.in...@gmail.com wrote: Recently a friend of mine ( necker at gibhub ) introduced me to Thalassa and Aqueduct: snip Is anyone running this kind of load balancer management system? Any recommendations ? I've experimented with a similar

[nodejs] Automatic clustering and log aggregation

2014-07-02 Thread Ryan Graham
There have been a couple discussions lately about logging, so I summarized my opinions in a blog post about how I think it should be done and which frameworks you should (not) use: http://strongloop.com/strongblog/automatic-node-js-clustering-with-log-aggregation/ The TL;DR is don't use logging

Re: [nodejs] Continue with package installation if node-gyp fails

2014-07-13 Thread Ryan Graham
I think you're looking for something like this: install: node-gyp rebuild || exit 0 Putting that in the scripts section of your module's package.json will prevent the installation of the module from failing just because node-gyp fails. ~Ryan https://twitter.com/rmgraham On Jul 11, 2014 8:49 PM,

Re: [nodejs] Re: A question on usage of require

2014-07-13 Thread Ryan Graham
It's only index.js by default. If there is a package.json in that directory it is used to look up the package's main entry point. It defaults to index.js, but it is often something like lib/someclass.js. ~Ryan On Sat, Jul 12, 2014 at 8:01 PM, Deva Kumaraswamy devakumaraswam...@gmail.com wrote:

Re: [nodejs] what is this code doing?

2014-09-11 Thread Ryan Graham
On Thu, Sep 11, 2014 at 2:41 PM, Reza Razavipour reza.razavip...@gmail.com wrote: function Param(stringifiedValue) { if (!this instanceof Param) { return new Param(stringifiedValue); } this.value = stringifiedValue; } Is this only doing away with the user having to

Re: [nodejs] How to set source on windows?

2014-09-13 Thread Ryan Graham
source is a *nix (or POSIX maybe?) shell command that reads the file (env_local in this case) and runs it in the current shell. It's been so long since I used Windows that I don't know if Windows has an equivalent. What you could do instead is set the environment variables directly yourself with

Re: [nodejs] Passing file descriptors between parent and child process

2014-11-07 Thread Ryan Graham
FWIW, I can't see anything wrong with your logic. Modifying naught to pass fd 11 to your app's cluster master looks like it should allow the cluster workers to listen with {fd: 11} and have that bubble up to the master. ~Ryan On Tue, Nov 4, 2014 at 7:18 PM, Ryan Schmidt

Re: [nodejs] mkdirp and EASSES

2014-11-18 Thread Ryan Graham
You can only setuid() to your own ID unless you are running as root. That is why it works for foo and root but not bar. ~Ryan On Tue Nov 18 2014 at 1:39:02 PM mark edwards edwardsma...@gmail.com wrote: hello all - first time posting. i am trying to run node.js from an account called foo and

Re: [nodejs] how to speedup http-proxy performance

2014-11-22 Thread Ryan Graham
On Fri, Nov 21, 2014 at 2:40 AM, nik600 AT 10^100 nik...@gmail.com wrote: Dear all i'm experiencing some performance-gap using http-proxy. I've got a very simple server that does the following: var http = require('http'); var httpProxy = require('http-proxy'); var proxy =

Re: [nodejs] Cluster question

2014-12-16 Thread Ryan Graham
Can you share how you accomplished this? (in code, if possible.. JS is way better than English with the diversity of backgrounds and native languages seen on this list) I'm not aware of a JS level API in node core that provides what you described, so like Sam, I assumed you meant a busy loop

Re: [nodejs] Re: writeConcern requires callback [newbie]

2014-12-20 Thread Ryan Graham
On Fri, Dec 19, 2014 at 10:46 AM, Zach Rollyson z...@izimobile.com wrote: Comes from the line menu.update({name:request.body.name}, menuObject, {upsert: true}, onUpdate) It's because mongoose update takes three arguments: document, options, callback. You have object, object, options,

Re: [nodejs] Re: writeConcern requires callback [newbie]

2014-12-22 Thread Ryan Graham
to model.update. I'm pretty sure he is calling document.update, and the error is because he has too many arguments. On Saturday, December 20, 2014 9:40:38 PM UTC-5, Ryan Graham wrote: On Fri, Dec 19, 2014 at 10:46 AM, Zach Rollyson za...@izimobile.com wrote: Comes from the line

Re: [nodejs] strange errors with npm install

2015-02-03 Thread Ryan Graham
-g/--global means install it globally, not in the project directory. I don't know what sort of errors you are seeing, but you are most certainly seeing warnings about those packages preferring to be installed globally. The second time you install them may be skipping the warning since they are

Re: [nodejs] Nube - Couchbase

2015-01-19 Thread Ryan Graham
Looks like the API changed in couchbase@2.0.0 (released in November), but I can't find a changelog or API docs in the repo. So +1 for following semver and -1 for documenting the breaking change? I didn't look hard, could be somewhere other than the repo: https://github.com/couchbase/couchnode

Re: [nodejs] Nube - Couchbase

2015-01-21 Thread Ryan Graham
installed and how do I deploy to other servers. Thanks again for all the help! On Tue, Jan 20, 2015 at 5:41 PM, Ryan Graham r.m.gra...@gmail.com wrote: You need to install the module inside your project, not inside your global node folder. While there are a few exceptions, dependencies

Re: [nodejs] Nube - Couchbase

2015-01-20 Thread Ryan Graham
e\build\Release\\couchbase_impl.node couchbase@1.1.1 node_modules\couchbase └── bindings@1.0.0 c:\Program Files (x86)\nodejs On Mon, Jan 19, 2015 at 7:55 PM, Ryan Graham r.m.gra...@gmail.com wrote: Looks like the API changed in couchbase@2.0.0 (released in November), but I can't find

Re: [nodejs] book or beginners tutorial about functional programming in node

2015-01-20 Thread Ryan Graham
I quite enjoyed JavaScript Allongé when I read through it and it happens to be free now: https://leanpub.com/javascript-allonge/read ~Ryan On Tue Jan 20 2015 at 12:33:50 PM Jeremy Darling jeremy.darl...@gmail.com wrote: You can almost always find something on the Essential JavaScript Links

Re: [nodejs] Re: Node.js foundation

2015-02-16 Thread Ryan Graham
On Wed Feb 11 2015 at 2:19:17 PM Luca Morandini lmorand...@ieee.org wrote: Point taken, but being effective does not imply being proper. Anyway, can someone point to me a public forum in which the establishment of the Node.js Foundation has been discussed ? I don't believe it was discussed

Re: [nodejs] Recommendation on what to return from module

2015-02-17 Thread Ryan Graham
Ideally the shape of your return values shouldn't change based on arguments. I think the application of this return shape principle is pretty clearly pointing at using 3 different functions, but it's possible the real code is more nuanced than that. ~Ryan On Tue Feb 17 2015 at 11:54:22 AM Mad

Re: [nodejs] See what is keeping the event loop alive

2015-01-24 Thread Ryan Graham
It sounds like you are looking for process._getActiveHandles(). You could set up a signal handler for SIGUSR2 or an unref()'d timer to log the output of that function to the console. It's not always the easiest to decipher, but it should give you some ideas of where to look. ~Ryan On Fri Jan 23

Re: [nodejs] circular requirements issues and suggestion

2015-01-27 Thread Ryan Graham
I can't say I've put any directed effort into trying to break require, but I've never seen anything close to the problems you are describing. Are you able to share any code that exhibits these problems? ~Ryan -- Job board: http://jobs.nodejs.org/ New group rules:

Re: [nodejs] Unhandled errors treatment in firebase-node

2015-01-11 Thread Ryan Graham
I'm grasping at straws here.. It is possible the intention was to make the exception uncatchable, suggesting the authors felt it is inappropriate to attempt to recover from the problem. ~Ryan On Sat, Jan 10, 2015, 6:48 AM Kirill Slatin kirill.sla...@gmail.com wrote: Humbly asking someone to

Re: [nodejs] Get HTTPS response outside of the current function

2015-01-06 Thread Ryan Graham
The closest you could get to returning the response in this case is to return a Promise, but that's probably a whole other discussion (which I can't describe any better than Marc Harter did in http://strongloop.com/strongblog/promises-in-node-js-with-q-an-alternative-to-callbacks/ ). Promises or

Re: [nodejs] StrongLoop announces most complete process manager for Node.js clustering with Nginx support built-in

2015-02-09 Thread Ryan Graham
StrongLoop's PM does indeed come with support for running as an OS service, and that is the strongly recommended way of using it. It comes with installers/generators for both Upstart (0.6 and 1.4 compatible flavours) and systemd, which take care of running as an unprivileged user, making the

Re: [nodejs] EventEmitter, emit from listener function

2015-03-22 Thread Ryan Graham
If I recall correctly, event emitters call event handlers with `this` bound to the event emitter itself. That means that your parse function is being called with `this` bound to the port that is emitting the event, not the GPS instance you got it from. ~Ryan On Fri, Mar 20, 2015, 7:50 AM

Re: [nodejs] strong-pm and multiple apps on one server

2015-04-26 Thread Ryan Graham
That is correct. Currently, in order to run multiple apps on the same server you would have to run multiple instances of strong-pm. I can't make any promises about dates, but multi-app really is coming soon. If one was really curious and/or wanted to make their own predictions, the repo is

Re: [nodejs] Node Cluster and context switching

2015-05-18 Thread Ryan Graham
If there is a process per CPU core, and the same process always runs on the same core, the result is generally *less* context switching. But that effect is nothing compared to the reason for the 1 worker per core recommendation. While node uses multiple threads behind the scenes, only one of

Re: [nodejs] Increase of parallel requests form node.js to external system takes more time to respond

2015-04-07 Thread Ryan Graham
Are you using a version of node that defaults to only 5 sockets for the global agent? ~Ryan On Tue, 7 Apr 2015 at 04:42 Kishore Kumar Yekkanti kishoreyekka...@gmail.com wrote: I have a simple case where I'm requesting a different upstream proxy server from my node.js server. With the

Re: [nodejs] formatting using dust templates

2015-06-04 Thread Ryan Graham
Dust will escape for you by default, which can be disabled with |h like you tried... ...but it looks like what you need is a step further, to *unescape* your string. There might be a filter for this outside of dustjs, but I don't believe it has anything like that builtin. ~Ryan On Thu, 4 Jun

Re: [nodejs] timed promises

2015-06-25 Thread Ryan Graham
Bluebird appears to have timeouts: https://github.com/petkaantonov/bluebird/blob/master/API.md#timeoutint-ms--string-message---promise ~Ryan On Thu, 25 Jun 2015 at 14:06 Gustavo Machado machad...@gmail.com wrote: Hi Alen, Check out the race method of promises, might help simplify this a

Re: [nodejs] Trouble with response.writeHead

2015-06-22 Thread Ryan Graham
I would expect NGINX to be doing some level of caching based on the ETag, but I would also expect it to be using the Content-Type as part of the cache validation, which is controlled by the Vary header. Here's a reasonable looking article (I only skimmed) on it that might give you enough

Re: [nodejs] timed promises

2015-06-26 Thread Ryan Graham
, the solution seems pretty clear - will switch to bluebird. Alen On Thursday, June 25, 2015 at 5:55:24 PM UTC-7, Ryan Graham wrote: Bluebird appears to have timeouts: https://github.com/petkaantonov/bluebird/blob/master/API.md#timeoutint-ms--string-message---promise ~Ryan -- Job board

Re: [nodejs] Express middleware to introduce proper cache headers

2015-06-18 Thread Ryan Graham
You need to set the appropriate cache control headers for the client to know that it doesn't even need to make a conditional request. Here's a decent write up on the relevant headers themselves: https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers

Re: [nodejs] Re: Node static directory case sensitive

2015-05-31 Thread Ryan Graham
A symlink for this won't work out well if you do development on Mac and/or Windows, since they default to using case-insensitive/case-folding filesystems. This gets doubly annoying if you are using git, since it is case-sensitive, even if the underlying filesystem is not. ~Ryan On Sun, 31 May

Re: [nodejs] recommended way installing nodejs 12.04 on ubuntu 14.04

2015-06-30 Thread Ryan Graham
The way I tend to do it is grab one of the binary tarballs and just do tar -C /usr/local --strip-compontents 1 -xf node-v0.12.5-linux-x64.tgz, normally by piping directly from curl (from a local mirror which I've already verified the checksums on!). But I tend to use VMs and containers and

Re: [nodejs] Is it possible to send a request to an http server if you only have a reference to the server object?

2015-06-30 Thread Ryan Graham
listens on a random port) and then then connecting to whatever's in server.address() would be the way to do that. Assuming there isn't a better way I'll give that a try. Thanks! On Tuesday, June 30, 2015 at 12:29:59 PM UTC-6, Ryan Graham wrote: If you only plan on using it from within

Re: [nodejs] Limit and handling of spawning child_process of ffmpeg

2015-06-27 Thread Ryan Graham
Are you using a client you wrote yourself in node? This sounds more like the maxSockets problem in the default http.Agent in node 0.10.x. ~Ryan On Sat, 27 Jun 2015 at 08:29 Ofir Attia ofirat...@gmail.com wrote: Hello, I facing with issue of nodejs and spawning child process. I have noticed

Re: [nodejs] Convert a multidimensional object to environment variables

2015-07-04 Thread Ryan Graham
That reminds me of what https://www.npmjs.com/package/nconf does when converting back and forth between environment variables and nested/namespaced config objects. ~Ryan On Sat, 4 Jul 2015 at 20:01 'Kevin Ingwersen (Ingwie Phoenix)' via nodejs nodejs@googlegroups.com wrote: Imagine you are

Re: [nodejs] localPort of a socket - possible bug in Node?

2015-07-02 Thread Ryan Graham
Looks like a bug, and I think I might even have a fix for it.. I'll submit a PR shortly, would you mind reporting the issue? ~Ryan On Thu, 2 Jul 2015 at 06:31 Phani Kumar phan...@gmail.com wrote: I am using 0.10.31 node version. I am facing an issue which looks like a bug in node. Just wanted

Re: [nodejs] localPort of a socket - possible bug in Node?

2015-07-02 Thread Ryan Graham
https://github.com/nodejs/io.js/pull/2095 ~Ryan On Thu, 2 Jul 2015 at 14:17 Ryan Graham r.m.gra...@gmail.com wrote: Looks like a bug, and I think I might even have a fix for it.. I'll submit a PR shortly, would you mind reporting the issue? ~Ryan On Thu, 2 Jul 2015 at 06:31 Phani Kumar

Re: [nodejs] Pooling in the net module versus http

2015-05-21 Thread Ryan Graham
No, the net module does not do any pooling like the http module does. ~Ryan On Thu, 21 May 2015 at 11:27 Rick O'Shea cogita...@gmail.com wrote: The http module and add-ons that use it (e.g., request) are pooled and we can set the pool size or turn if off: http.globalAgent.maxSockets. I want

Re: [nodejs] Is it possible to send a request to an http server if you only have a reference to the server object?

2015-06-30 Thread Ryan Graham
If you only plan on using it from within the process, you could use an ephemeral port binding, which shouldn't tie up a useful TCP port. ~Ryan On Tue, 30 Jun 2015 at 09:02 Greg Reimer g...@wayin.com wrote: Basically, it would be nice to be able to create a server object that I could have in

Re: [nodejs] Address hostname failure on Windows

2015-07-29 Thread Ryan Graham
Your listening address is the equivalent of 0.0.0.0, which Windows does not like to connect to. The solution for your IPv6 case is the same as for IPv4, which is to give a host address. Unfortunately that means on Windows you can't do what you're trying to do with an ADDRANY listening socket.

Re: [nodejs] Datagrams on Linux and Windows

2015-08-04 Thread Ryan Graham
Just to rule out the obvious, are your Linux tests done on VMs that are NATed behind a virtual network? ~Ryan On Mon, Aug 3, 2015, 7:53 PM Matthew McConnell maca...@gmail.com wrote: So im trying to write a simple script to download Steam's master server list. The code I have works on Windows

Re: [nodejs] Do anyone know why I'm getting this?

2015-07-30 Thread Ryan Graham
It looks like you have an a tag somewhere in your app that doesn't have a closing on the href and it is adding the following class attribute as part of the URL. ~Ryan On Thu, 30 Jul 2015 at 09:55 Kelvin Knighton kelthe...@gmail.com wrote: I'm trying to track this issue, I've looked in

Re: [nodejs] Deploying NodeJS

2015-08-10 Thread Ryan Graham
You run node directly (or via a process supervisor). It is not typically run under an application server like Tomcat. It is often run _behind_ a web server, such as NGINX or Apache, operating as a reverse proxy and serving up static content. As for how to serve many urls in a single piece of

Re: [nodejs] Nodejs memory leak? consumption high?

2015-07-24 Thread Ryan Graham
It is running with multiple processes because it clusters itself by default: https://git.wikimedia.org/blob/mediawiki%2Fservices%2Fparsoid.git/92f1cd6d87a0b233edcc15b999e9bfab34b23da6/api%2Fserver.js#L38 As for the memory usage, I'm not familiar enough with it to know what would be normal. ~Ryan

Re: [nodejs] RSA Crypto ?

2015-07-17 Thread Ryan Graham
Do you mean supported by joyent/node instead of iojs/node? They're the same in this case: https://nodejs.org/api/crypto.html#crypto_crypto_publicencrypt_public_key_buffer ~Ryan On Fri, 17 Jul 2015 at 08:39 eric calid...@gmail.com wrote: great, do you know when will nodejs support rsa ? stuck

Re: [nodejs] q promise and map doesn't change after iteration

2015-07-17 Thread Ryan Graham
Is it your intention that each id iteration gets its own localEncounter object? If so, you'll want to move its declaration inside your map iterator. As it is, each id's chain is sharing the same object, and they are likely going through their phases at different times/speeds, so it's impossible to

Re: [nodejs] Memory leak

2015-07-07 Thread Ryan Graham
Here's a few ideas.. 1. Is your app actually crashing due to lack of memory? If not, it is possible that it is not actually leaking memory but V8 just isn't running low enough to bother doing any garbage collection. This behaviour is often mistaken for a memory leak. 2. `delete datas0`, `delete

Re: [nodejs] Seeking second opinion and advice on 'req.domains' problem - possible node.js bug

2015-07-10 Thread Ryan Graham
It's not clear from your email or the commit message what you think the bug is... If you are referring to how it assumes the base of the domain is X.Y, there is a setting for that: - 'subdomain offset', which defaults to 2 - http://expressjs.com/api.html#app.settings.table If that's not what

Re: [nodejs] Domain module in nodejs 4.0.0

2015-09-13 Thread Ryan Graham
That's what the text you quoted says. It's not deprecated yet, but it will be as soon as there is a replacement. 1. Pending deprecation, looking for an alternative <-- now 2. Deprecated, will print warnings if you use it<-- probably not 4.x 3. Removed, will fail with undefined

Re: [nodejs] Node/Express best practice regarding multiple apps on 1 instance

2015-09-14 Thread Ryan Graham
The Ubuntu package for nginx would have set it to start automatically, if I recall correctly. I don't recall off the top of my head if it uses sysv init scripts or Upstart, though. Since you are on Digital Ocean, you may have noticed that they offer credits for users who write how-to guides. As a

Re: [nodejs] require/resolve and the exclusion of the node_modules folder

2015-09-29 Thread Ryan Graham
Here's a (possibly over) simplified description: If given a path (starting with ../, ./, or /), the path is used as is, relative to the current file. If a module-name is given, it basically looks for: ./node_modules/ ../node_modules/ ../../node_modules/ ../../../node_modules/ ... /node_modules/

Re: [nodejs] node-ses error .

2015-09-19 Thread Ryan Graham
You are giving 'hello' as an email address to CC. ~Ryan On Sat, 19 Sep 2015 at 12:08 Anup Panwar wrote: > Am trying to send email throw node-ses but am getting error .. > > { Type: 'Sender', > > Code: 'InvalidParameterValue', > > Message: 'Missing final \'@domain\''

Re: [nodejs] Convert C struct in nodejs code

2015-09-24 Thread Ryan Graham
You probably want to start by reading up on nan and some of the v8 documentation it links to: https://github.com/nodejs/nan It includes some helpers and wrappers that might help, but more importantly it will make it a lot easier to be compatible with multiple versions of node if/when that becomes

Re: [nodejs] Cannot run node.js packages in Virtualbox Shared folders

2015-09-24 Thread Ryan Graham
The problem is symlinks, which is what npm uses to create the runnable commands for those modules. There are a bunch of options involving config tweaks, setting up network file sharing, or some semi-automatic invocation of rsync... ...but you might find it easiest to just keep your image assets

Re: [nodejs] Re: Parameter url must be a string, not undefined

2015-12-14 Thread Ryan Graham
You are reading the URL for your MongoDB connection from an environment variable but it appears that you have not actually set it, so it is showing up as an undefined value in your code. ~Ryan On Fri, 11 Dec 2015 at 12:16 binaryMoods wrote: > And my updated code is here >>

Re: [nodejs] Last Object in Array Goes Missing

2016-01-05 Thread Ryan Graham
Where is data defined? It is hard to tell from the limited context what else touches it. Remember that your callback is being called after Users.find() returns, so if you are modifying that data array in any lines after that call to Users.find(), they will modify the data before your

Re: [nodejs] Using async's forEach

2015-11-27 Thread Ryan Graham
I don't see a forEach in the async docs, but based on your usage it looks like you are trying to use forEachOf... Except the 3rd argument of the iterator would be the callback for moving on to the next item and it expects an error or null as its only argument. It also expects to be given an

Re: [nodejs] Re: [weird] console.log is not sync anymore when I use a stream, output is truncated when it s followed by process.exit

2016-05-25 Thread Ryan Graham
On Tue, May 24, 2016, 9:14 PM Zlatko wrote: > On Monday, May 23, 2016 at 4:57:29 PM UTC+2, mh-cbon wrote: >> >> Hi, >> >> I m facing a badly weird issue which i can t tell if it s a bug, or an >> error from my side. >> >> > It's not a bug, it's a feature :) > > Seriously,

Re: [nodejs] POST changes to GET

2016-06-17 Thread Ryan Graham
If you are getting a redirect then there should be a Location header with a new path or URL in it. Use that to create a new request. It is up to you which HTTP method you use for that request. ~Ryan On Fri, Jun 17, 2016, 7:28 AM Michael Chenetz wrote: > I have a page that i

Re: [nodejs] Something strange going on in Async callback

2016-06-17 Thread Ryan Graham
I don't see anything obvious, but these are the questions I would be asking myself while investigating. Is "someClass.someFunction" taking a single use call callback? Or does the first call to it register the callback somewhere and then reuse it for future results? Your extra closure wrapping

Re: [nodejs] Re: I need a way to install npm packages offline

2016-03-19 Thread Ryan Graham
On Tue, 15 Mar 2016 at 08:33 Gilberto Valentin wrote: > ../node_modules/nan/nan.h:41:3: error: #error This version of node/NAN/v8 >>> requires a C++11 compiler >> >> In file included from >>>

Re: [nodejs] how to link to installed node packages / modules from another dir

2016-03-27 Thread Ryan Graham
On Sun, Mar 27, 2016, 2:12 PM NodeNinja wrote: > 1. Is this a limitation of node modules or something to do with "sqlite3" ? > Not a limitation, just the recommended practice. If your apps all share their dependencies then they must all use the same versions. 2. Why didn't

Re: [nodejs] Appending to array - Not working as expected

2016-08-03 Thread Ryan Graham
In your code you are doing this: var jsontemp=jsonstr; This is not making a copy of jsonstr, it is making an alias that points to the same object. This means that later when you are modifying jsontemp.a you are also modifying jsonstr.a and when you push jsontemp on to your array, you are pushing

Re: [nodejs] Node using all processors without clustering. How come?

2016-07-20 Thread Ryan Graham
The part of node that is single threaded is the JS execution. All of the async calls like I/O and most system calls are handled by a combination of a thread pool and the OS's scheduler. If your app mostly just passing data around and not doing a lot of processing on it then it is certainly a

Re: [nodejs] Handling Licensing in NodeJS

2016-07-15 Thread Ryan Graham
My advice is to not bother trying to make it super secure. If you are shipping JavaScript then at some point there will likely be an option for the user to just comment out the line where you do the check. If you attempt to engage in some sort of arms race with node as the battlefield, you're

Re: [nodejs] highly asynchronous app gets stuck

2016-08-08 Thread Ryan Graham
I only had a few minutes to look for obvious things, so I don't have a solution, but I do have some observations. 1. You've done a pretty good job at organizing the code from what I've see, so +1 to that. 2. You seem to be under the impression that child_process.fork() spawns threads, when it is

Re: [nodejs] EMFILE error on bulk data insert through HTTP-REQUEST

2016-07-23 Thread Ryan Graham
This was also posted on stackoverflow earlier (where I posted my reply). http://stackoverflow.com/q/38540288/62525 ~Ryan On Sat, Jul 23, 2016, 10:59 AM ManojKumar G wrote: > Hi all, > I'm developing an loopback application to get data using oracledb npm > module from

Re: [nodejs] (node) warning: possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit.

2016-09-04 Thread Ryan Graham
The EventEmitter class logs this warning when there are more than the 10 listeners subscribed to an event. The number is configurable, with 10 as the default. You are seeing 11 because it was the eleventh listener being added that triggered the warning. The warning is meant to warn you in case

Re: [nodejs] how to link to installed node packages / modules from another dir

2016-10-03 Thread Ryan Graham
Dependencies are loaded relative to the location of the code, not your current working directory. If you have code in foo/dir1/proc1.js and code in foo/dir2/proc2.js, they will both see modules in foo/node_modules regardless of which directory you run them from (eg. `cd /bar/dir3; node

Re: [nodejs] Is it possible to halt npm install before running any install scripts?

2016-10-13 Thread Ryan Graham
You could do `npm install --ignore-scripts`, run your checks, and then do `npm rebuild`. That should do what you want. These commands are also useful for bundled dependency workflows, by the way. ~Ryan On Thu, Oct 13, 2016, 3:38 AM Paul Johnston wrote: > I'd like to be able

Re: [nodejs] Express route variables conflicts

2016-10-09 Thread Ryan Graham
Your little code snippet shows that you're declaring id inside the route handler to correctly scope it by request, and your async.serial() call is correct as far as is shown... For the closure around id to work as you desire, you also need to define f1 and f2 inside the request handler. Your