Re: [nodejs] what are the merits / demerits of require.extensions?

2013-05-13 Thread Bradley Meck
Encrypting source code is not something that can be done in v8 due to Function.toString and how v8 stores code for recompilation. The source will be present in v8's heap somewhere. However, if all JS is encrypted with a secret key and that must be provided before v8 starts it is possible to

[nodejs] Re: Can we rely on the semver implementation in npm?

2013-04-30 Thread Bradley Meck
See : https://github.com/isaacs/node-semver/blob/master/test.js Does not have all the '+' checks you may want, but on glance it looks like it would be fine except build.2 to build.11 (anything after + is lexically sorted, semvers are not recursive by definition) -- -- Job Board:

[nodejs] Re: NPM Downloading Binaries

2013-04-17 Thread Bradley Meck
Arch specific registries using multiple registry support is much simpler. npm --registries=ubuntu.x64.prebuilt.local registry.npmjs.org when requesting against ubuntu.x64.prebuilt.local a proxy would prebuild the module if it 404s. end. Can be done as an internal proxy as well. -- -- Job

[nodejs] Re: Curious question about node/lib/module.js

2013-04-10 Thread Bradley Meck
I am very wary of the module system needing to load modules, the less external dependencies the better. That being said, you could use the built in util functions, but then if a user application modifies the util functions it will cause problems in module.js; tradeoffs. -- -- Job Board:

[nodejs] Re: NodeJS modules --- implementation

2013-04-09 Thread Bradley Meck
Correct, however 2 pieces of bindings are used in node's case (dlopen and fs for reading files/dirs). The rest is all in Javascript. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message

[nodejs] Re: NodeJS modules --- implementation

2013-04-04 Thread Bradley Meck
Also there is a shim for re-creating this in user space: https://github.com/bmeck/node-module-system , see example for `node`'s system. On Thursday, April 4, 2013 2:29:20 PM UTC-5, mscdex wrote: On Apr 4, 2:45 pm, Blaž Sovdat blaz.sov...@gmail.com wrote: I'd like to know where in the

Re: [nodejs] $prefix/include/node/*.* headers missing in v0.10.x

2013-04-03 Thread Bradley Meck
The one downside I have noted with node-gyp is how much of a pain it is to bundle some package as a dependency that includes a different build manager like cmake. Perhaps that is the situation here. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: ECMAScript 6, asm.js, can node.js dump V8 or be VM agnostic?

2013-04-03 Thread Bradley Meck
My main problem is not with JS but having native modules break if we do this. V8's C++ API is significantly easier to use than the other JS VMs when I have done experiments, however, that C++ API makes some assumptions that are not always true across JS Core, Nitro, or the Monkey engines.

[nodejs] Re: customize local node.js ( switch to require module / .noderc.js ? )

2013-04-03 Thread Bradley Meck
I think this is a little out of scope for node-core, some test runners for example do automatically include various bootstraps and/or globals (chai in particular comes to mind). Having this in included as a CLI flag would need to have some serious points about why this would be beneficial over

Re: [nodejs] Promises vs Async vs Stepdown vs etc... Request for non-trivial implementation ideas.

2013-04-01 Thread Bradley Meck
When we have been making large scale software a few things have come up. 1. Callbacks suck for linear workflows (a-b-c) This kind of workflow results in what I like to call the mudslide. Your code really wants to expand into some minor nesting once you have shared state (sometimes immutable

Re: [nodejs] Promises vs Async vs Stepdown vs etc... Request for non-trivial implementation ideas.

2013-04-01 Thread Bradley Meck
Domains are useful to categorize and debug the error, even if you shutdown, don't just throw them away. For performance starved JS (talking working under 50MB in a production area) idempotentcy / stateless arch generally results in memory usage or offloading to a single authority. Single

[nodejs] Re: Promises vs Async vs Stepdown vs etc... Request for non-trivial implementation ideas.

2013-04-01 Thread Bradley Meck
Manually combining state is something I do not want to give up. Passing by argument is my preferred method rather than introducing variables (async.waterfall). All compiler based syntaxes I have seen give me concerns about shared cache if multiple things are done in parallel and you use shared

[nodejs] Re: Promises vs Async vs Stepdown vs etc... Request for non-trivial implementation ideas.

2013-04-01 Thread Bradley Meck
https://gist.github.com/bmeck/5287456 Feel free to spec out a reference problem set by forking and modifying. -- -- 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

[nodejs] Re: Native modules in the cloud

2013-03-27 Thread Bradley Meck
This should also specify if you are using Windows or not when making the decision. Native modules on Windows are less common due to the semi-long setup needed to make/secure a build server for me. On *nix modules are amazingly useful, but on windows I usually end up offloading complex native

[nodejs] Re: Is it possible to create a node.js module wich uses c libraries for database connection?

2013-03-22 Thread Bradley Meck
If you just want to call into C https://github.com/rbranson/node-ffi or If you actually need to deal with the event loop (such as doing things in multiple threads and queueing them on the loop): http://nodejs.org/api/addons.html On Friday, March 22, 2013 11:10:49 AM UTC-5, Gaurav Meena wrote:

[nodejs] Re: Return-Code 7 while running npm from python

2013-03-21 Thread Bradley Meck
Did npm-debug.log say anything? Can you gist that output? On Thursday, March 21, 2013 4:13:57 AM UTC-5, Christian S. wrote: Hi, I always get the return code 7 when I run npm search term from python ( subprocess.check_output([ 'd:/nodejs/npm.cmd', 'search', 'connect' ], shell=True) ). When

[nodejs] Re: documents/second instead of seconds/document

2013-03-14 Thread Bradley Meck
Can't seem to click on the link (404ish style page saying missing or not shared). -- -- 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

[nodejs] Re: Missing execSync in NodeJS

2013-03-14 Thread Bradley Meck
https://github.com/joyent/node/issues/1167 - stdio options need to be specced out still. -- -- 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

Re: [nodejs] Missing execSync in NodeJS

2013-03-14 Thread Bradley Meck
Most real world use cases for this are not for performance, they are for shelling out to utilities, the alternatives are hideous as we found in nsh : https://github.com/AvianFlu/nsh/wiki/nsh -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: Found a really nice video about NodeJS

2013-03-13 Thread Bradley Meck
For reference to those who are taking this seriously: multiple comments asking for sources/examples on many issues brought up (in video and comments) should lead to skepticism about many of his claims in the comments. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: SSL termination

2013-03-08 Thread Bradley Meck
Unless you really need to script out SNI and/or NPN negotiation in your balancer, termination via `stud` or something else is recommended on 0.8.x unsure on 0.10.x. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: [ANN] Modulus Node.js Hosting Platform Goes Live

2013-03-06 Thread Bradley Meck
Congratulations on going public :). Always good to see the Node community thriving. Cheers, Bradley -- -- 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

[nodejs] Re: Distributing an application

2013-03-06 Thread Bradley Meck
You should check out module-smith; let me know if you need help setting it up properly. Make tarballs / zips and distribute them directly as precompiled binaries. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

[nodejs] Re: Directory structure suggested in node docs

2013-03-05 Thread Bradley Meck
Well right now the cache (~/.npm) does follow this but does local copies instead of linking when using `npm install`. Linking is only going to happen with `npm link` so that nothing in a project can change out of band unless it was explicitly linked. -- -- Job Board: http://jobs.nodejs.org/

[nodejs] Re: Directory structure suggested in node docs

2013-03-04 Thread Bradley Meck
This structure is currently present in node. * NPM uses local modules in a similar structure with `/usr/lib/node` replaced with the directory containing your `package.json`. * Global modules are installed as local modules name-spaced to the appropriate directory such as `/usr/lib/node_modules`.

[nodejs] Re: Self-contained and self-extracting Node.js applications

2013-02-26 Thread Bradley Meck
There are some projects on this already such as `nexe`. If you want to talk about it in depth feel free to ping me on irc. -- -- 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

Re: [nodejs] Re: Self-contained and self-extracting Node.js applications

2013-02-26 Thread Bradley Meck
I think both `nexe` (dont quote me im not on project) and the private versions I know of are looking to windows as the main usage for bundling. NJ is looking into security around bundled executables before we do anything public. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: Run Meteor apps anywhere with Demeteorizer

2013-02-26 Thread Bradley Meck
Very interesting. Looks like some good things for us people who are used to vanilla node projects far more than meteor. -- -- 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

[nodejs] Re: announcing browserify v2

2013-02-25 Thread Bradley Meck
We are doing some dark magic upcoming using https://github.com/bmeck/node-module-system +1 if we can get a standardized require shim. Does not need to be ours. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You

[nodejs] Re: announcing browserify v2

2013-02-25 Thread Bradley Meck
Generally I abstract out my implementations and my interfaces. This means a more verbose code base, but allows me to have the renderer inserted via dependency injection. It is independent of bundling tech and I have used it with browserify as well as with AMD to great success. Decoupling those

[nodejs] Re: module.exports and property descriptors

2013-02-21 Thread Bradley Meck
Loading in modules can be time consuming for one off apps or resource constrained apps. This only requires them when they are being requested. For long running apps that can consume time and resources at startup this is generally not needed / wanted. -- -- Job Board: http://jobs.nodejs.org/

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

2013-02-18 Thread Bradley Meck
Right now without compaction you are looking at 45~ GB of data it looks like on the current npm public registry, and it can be replicated without needing any permission. On Monday, February 18, 2013 1:01:33 PM UTC-6, andy wrote: Cool, thanks for the suggestion(s). Two quick questions: 1)

Re: [nodejs] Proxy server with authentication

2013-02-14 Thread Bradley Meck
Any reason not to use http-proxy and passport without express? -- -- 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

[nodejs] Re: http/ https server on same port

2013-02-06 Thread Bradley Meck
A long time ago I built a proof of concept for something like this: https://github.com/bmeck/kitsune After thinking about maintainability I decided to avoid doing this sort of behavior but left the code up as an example. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: Re - How to add new row to existing document in couchDB Database .

2013-01-31 Thread Bradley Meck
GET the document from CouchDB, change the row appropriately, PUT it back to CouchDB. All using HTTP. CouchDB will complain about merge problems if the _rev field does not match, if so, retry. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: Harmony Proxies for abstracting Mumps GlobalNodes

2013-01-31 Thread Bradley Meck
Proxies are a turtles all they way down approach for things like this, don't return the actual property, return a Proxy to the property that can have reference to the path used to get there. However, this ruins performance, and cannot represent primitives as values. A function for full path

[nodejs] Re: Harmony Proxies for abstracting Mumps GlobalNodes

2013-01-31 Thread Bradley Meck
I really like proxies, but they are not a cure all; in some situations they are very very beneficial (NodeList in the DOM spec for example), but they do not like valued tree structures. But yes a function that delegates out to a tree structures is what I would recommend. -- -- Job Board:

[nodejs] Re: pipe to node binary and still pass parameters

2013-01-30 Thread Bradley Meck
use xargs and -e instead of a direct pipe. On Wednesday, January 30, 2013 2:36:04 PM UTC-6, Kilian C. wrote: using /dev/stdin as file reference kinda works $ echo console.log(process.argv) | node /dev/stdin --myarg [ 'node', '/dev/stdin', '--myarg' ] but it messes with the node_modules

[nodejs] Re: Healthcare needs the help of the Node.js Community

2013-01-27 Thread Bradley Meck
Are there any conventions when sharing data between 2 mumps databases? Format or otherwise? -- -- 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

Re: [nodejs] Re: Healthcare needs the help of the Node.js Community

2013-01-27 Thread Bradley Meck
Any errors in the interpreter/compiler could have impact on peoples well being, I would advise against doing this on old code that has been functional for long periods of time and may rely on edge cases. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: Bangalore JS Meetup tomorrow at Microsoft offices in India

2013-01-27 Thread Bradley Meck
Dependencies on a resource is pretty fancy pantsy. I like it. Reflected web admin trigger admin... http://memegenerator.net/instance/33969625 -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this

[nodejs] Re: Bangalore JS Meetup tomorrow at Microsoft offices in India

2013-01-25 Thread Bradley Meck
Good to see you around. Keep us up to date with any slides / videos :) -- -- 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

[nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread Bradley Meck
Are we talking about the frame limitation here? Packets above a certain size will be split into frames as appropriate. -- 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

[nodejs] Re: Running javascript code safely

2013-01-20 Thread Bradley Meck
Austin : https://github.com/joyent/node/issues/2486 https://github.com/joyent/node/issues/3042 -- 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

Re: [nodejs] Running javascript code safely

2013-01-19 Thread Bradley Meck
Alexey, depends on the system. Long story put short: If you have persistent workers (say one per user not per request), this can be beneficial in some situations where running user code on your machines is less costly than sending things over network or for security you cannot (ie. something

Re: [nodejs] Running javascript code safely

2013-01-18 Thread Bradley Meck
A better use of time is supporting SES ( https://github.com/drses/ses ). It needs a legitimate CommonJS wrapper without globals and documentation on usage. See bin/ses for an example. As a side note: you will want --harmony support. Once you have an OS protection layer and that you are in ok

[nodejs] Re: Running javascript code safely

2013-01-18 Thread Bradley Meck
Austin: won't go into great detail, but heres a fun little example: ```javascript function exploit() { console.log.constructor(process.exit(42))(); } var result = require('vm').runInNewContext([ 'use strict;', '('+exploit.toString()+')()' ].join('\n'), {console:console}); console.log('I

Re: [nodejs] Re: Running javascript code safely

2013-01-18 Thread Bradley Meck
See my earlier post with OS security and the various things about it. Even in a child process you can wreak havoc. Also, you need to pass in some sort of context or get some sort of output for you to do anything of value. It needs to be made into a string, fire some function, return a value, or

Re: [nodejs] Running javascript code safely

2013-01-18 Thread Bradley Meck
Yes, for basic scripts gf3's module works fine, but still stick to OS security as well in case a new JS exploit arises. The reasons it is ok is as follows: 1. Communication uses serialization in a safe runner generated inside the context that is in strict mode. (General idea from #7) 2. RPC is

Re: [nodejs] Running javascript code safely

2013-01-17 Thread Bradley Meck
A while back I discussed the problems with the node-sandbox module, I wrote a solution, but it broke on newer v8s, have not spent the time to track down the problem. Even then serious care must always be taken to not allow remote code execution. I know ways that horrify people using just type

Re: [nodejs] Running javascript code safely

2013-01-17 Thread Bradley Meck
Hey Mark, Is there a sandbox to test out SES in, or binary I can run with examples? Looked in the SVN but did not see a Readme to get started with. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this

[nodejs] Re: v8 profiler output question

2013-01-17 Thread Bradley Meck
What is `time node --prof x.js`, always check `time`. Also C++ level stuff for in depth profiling use a C++ profiler, `gprof` for gcc etc. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message

[nodejs] Re: Running javascript code safely

2013-01-17 Thread Bradley Meck
You can run it perfectly safely, but always understand you want the OS for protection. That is the first line, not a module. Now running something with shared code... harder, but SES shows promise and does what I mentioned using wrappers; hopefully, we will see it usable in both browser and

[nodejs] Re: Debian Nodejs Package Maintainer

2013-01-14 Thread Bradley Meck
writing -- 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 To

[nodejs] Re: Memory used by an object in node.js

2013-01-11 Thread Bradley Meck
Profile the machine, 51 elements means very little overall. The elements could vary in size from a vast number of reasons (the simplest being you have strings of different sizes). You could also have a daemon watch RSS usage of the machine to react accordingly while you profile by making

Re: [nodejs] Does events gets executed sync'd or async'd?

2013-01-11 Thread Bradley Meck
If you need to break something off as to not interfere for w/e reason, look at `process.nextTick`, if you need to chain together a reaction to an event from async functions look at `async` from https://github.com/caolan/async or `understudy` from https://github.com/bmeck/understudy depending on

Re: [nodejs] Convention to preemptively break out of a domain/action?

2013-01-08 Thread Bradley Meck
Completely agree that not having the default action at the end would cause issues in a single middleware stack. I use middleware trees rather than single stack with Understudy, it would go to the end of an action (for example the default action such as just closing the HTTP request). I run

Re: [nodejs] Convention to preemptively break out of a domain/action?

2013-01-08 Thread Bradley Meck
I am not sure I understand the use of a pull stream in this context. Can you explain in a small example of how to use a stream instead of domains/middleware/etc. in this fashion for control flow? On Tuesday, January 8, 2013 3:59:29 AM UTC-6, Raynos wrote: Sounds like you want a pull stream to

[nodejs] Convention to preemptively break out of a domain/action?

2013-01-07 Thread Bradley Meck
Anyone have a sane and performant way that they break out of a domain or action such as middleware? I am trying to design such behavior but am faced with a multitude of interesting issues. The classic example of this problem can be seen with Array.prototype.forEach (though this has the easier

Re: [nodejs] Convention to preemptively break out of a domain/action?

2013-01-07 Thread Bradley Meck
This is good, gets me thinking. This brings up that there are 2 styles of approaching this issue: abort style - manually cause the action to fast fail condition style - provide a condition to check on every step of the action May help others thinking about this as well to think of both

[nodejs] Re: Autoload and autoinstall modules

2013-01-02 Thread Bradley Meck
What are the security features to prevent malware installation using this? -- 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

[nodejs] Re: convention for publishing modules requiring --harmony?

2012-12-29 Thread Bradley Meck
Well if its just runtime needs, you could throw an error on require if a global for w/e you need is not present? Placing Javascript dialect into the package.json would get complex and hairy quite quickly. -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] Re: convention for publishing modules requiring --harmony?

2012-12-29 Thread Bradley Meck
If you are using a non-standard (harmony) expectation in your library you should test and bail on an environment that does not supply the interfaces expected. I think throwing on missing expectations is one solution the other is to require a shim if the expectation is not present. Both are

Re: [nodejs] Substream of Streams2 ReadableStream

2012-12-27 Thread Bradley Meck
Fixed using nextTick in https://github.com/bmeck/node-tart/blob/b44c960b18904b4ba1b36f02c2e3f569af948503/lib/substream.js . Basically, when having a stream that has read the end of it's data and is also ending at the same time, you need to nextTick the cb(null, null) otherwise the consumer

Re: [nodejs] requesting guidance on possible contributions: reassigning console.log to a different stream and enabling debugger programmatically

2012-12-27 Thread Bradley Meck
Debug: At least give a way to disable it for when im doing live debugging and want to regain the port and debug a different process. On Thursday, December 27, 2012 10:51:44 PM UTC-6, Isaac Schlueter wrote: On Thu, Dec 27, 2012 at 6:52 AM, Joel Brandt jobr...@adobe.comjavascript: wrote:

[nodejs] Substream of Streams2 ReadableStream

2012-12-23 Thread Bradley Meck
I have a situation where I want a sub-stream (in same manner as a sub-string) of a ReadableStream to be treated as a different stream entirely. Currently I have the following: ``` // // Create a stream that consumes a future part an existing stream // var ReadableStream =

[nodejs] Re: Stream2: How to create readable stream for redis subscribe?

2012-12-21 Thread Bradley Meck
Personally I did not want to write a buffering system for in memory _read and just used a PassThrough stream for node-tart's substream parts : https://github.com/bmeck/node-tart/blob/master/lib/substream.js . I'm trying as well to find a sane way to allow internal buffering from a different

[nodejs] Re: The new game server demo written in node.js

2012-12-12 Thread Bradley Meck
Very interesting. Seems to still have some graphical jitters, but could be very promising. Cheers, Bradley -- 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

[nodejs] Re: Best Pattern to wrap class hierarchy

2012-12-10 Thread Bradley Meck
Encapsulated bindings. Make all bindings available w/ some naming convention for the namespaces. Have a constructor function per type * Have Animal.prototype be the members of Animal:: * Have Dog.prototype be the members of Dog:: Attach the static functions to constructor functions Add sugar if

[nodejs] Re: Need recomendation for a native folder compression tool

2012-12-06 Thread Bradley Meck
I think the main reason people encourage others to compile to JS is that it can be a prepublish script to npm (you don't have to change .coffee to .js manually every publish) and in doing so you do not require 'coffee-script' to be loaded by the module that uses yours, making requirements of

Re: [nodejs] Re: find path of module require()ing

2012-11-20 Thread Bradley Meck
Depends, if a module holds a reference to the module being reloaded and there is a shared cache being used by that module. You would still end up with 2 references to different things. I would need to know way more about whats trying to be done / API to make any sane comment on if it looks like

Re: [nodejs] Re: find path of module require()ing

2012-11-19 Thread Bradley Meck
If the module uses some form of internal storage (for caching, module level object registration, etc.) it would be duplicated and then you could see some interesting cache mismatch bugs. For example in the following module 2 registries would exist rather than the expected one if completely

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

2012-11-12 Thread Bradley Meck
Choose either, I do things in callback style personally to match the ecosystem when I write libraries, thats the expectation of the ecosystem. For application logic, do whatever makes it faster. There are exactly 0 absolute wins on either side. I can go on at length about the reason both have

Re: [nodejs] Re: Question about threads in node.js

2012-11-09 Thread Bradley Meck
Correct but people use factory functions based on string lookups in most of these modules for some forsaken reason (udp/tcp do not have same api basically). On Friday, November 9, 2012 1:32:39 PM UTC-6, Matt Sergeant wrote: Yeah that was the one. I thought mDNS was just DNS packets sent over

Re: [nodejs] Re: PaaS that allows node.js to use non-http ports?

2012-11-07 Thread Bradley Meck
Yep, but there are interesting ways to do things still, like STUN and SOCKS bindings if you have a proxy of your own out there you can generally setup the tunnel inside most PaaS. Generally though the PaaS is stuck to preallocating port/host pairs and charging for them since most don't give

[nodejs] Re: PaaS that allows node.js to use non-http ports?

2012-11-06 Thread Bradley Meck
Having worked on load balancers I can say load balancing multiple apps on raw TCP is less than trivial. Basically you end up having to make users declare their socket needs before hand, and you assign a host:port that will map to their app inside the internals of the PaaS. If someone has good

[nodejs] Re: extensible packages

2012-11-06 Thread Bradley Meck
This sounds like a shared state lookup. Document and specify an interface for the renderers (webgl and 2d in this case). Once you have done that, in getContext Surface.prototype.getContext = function (name, options) { var renderer = this._renderers[name] // _ prefix is for implementation

[nodejs] Re: Module caching Caveats

2012-11-01 Thread Bradley Meck
Posix has the ability to have hard links on disk where they have the same inode but different paths, unsure if this affects Window's junctions in the same way though. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

Re: [nodejs] Weak references. Does node-weak and other simliar libraries, add significant overhead?

2012-10-24 Thread Bradley Meck
Take it to a different topic if it becomes unrelated also. On Wednesday, October 24, 2012 1:15:49 PM UTC-5, Marco Rogers wrote: Can you elaborate on domains just feel wrong. I'm interested in how the domains api comes across. I've expressed my concerns with it in the past. :Marco On

[nodejs] Re: Installing modules in a flat directory

2012-10-18 Thread Bradley Meck
1. npm dedup can help. 2. if that is not enough: all modules can reference parent module's node_modules, so if you recursively move all dirs into the root node_modules it should work. a/node_modules/b/node_modules/c - a/node_modules/c On Wednesday, October 17, 2012 1:07:54 PM UTC-5, Justin

[nodejs] [ann] module-smith

2012-10-14 Thread Bradley Meck
We at Nodejitsu are releasing a part of our build server, Module Smith. It is the NPM wrapper we are using after we have stripped out all of our fancy logic. As with most build servers, the permissions you run this under should be taken into consideration. We have stripped out a lot of our

[nodejs] Re: [ann] module-smith

2012-10-14 Thread Bradley Meck
Link may be important: https://github.com/nodejitsu/module-smith -- 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

Re: [nodejs] NPM: How to install packages without compiling them

2012-10-14 Thread Bradley Meck
that would do that. On Thursday, October 11, 2012 9:30:12 PM UTC+2, Bradley Meck wrote: you can do something like ``` npm i cat package.json | json -e this.bundledDependencies='$(for FILE in $(ls -A node_modules); do printf $FILE ; done)'.split(/ /) package.json npm pack ``` We do

[nodejs] Re: multiple applications in single node.js process

2012-10-13 Thread Bradley Meck
Isolates were taken a look at a while ago. They are similar to what you want, but still unable to do so. It would generally be more sane to just scale out processes was what was decided. The edge cases of giving multiple light weight isolates proved to be very difficult to prevent Isolates

Re: [nodejs] peeves current best practices?

2012-10-13 Thread Bradley Meck
My problem is not with using Travis, it is a warning. Travis does sometimes fail, and we have had situations where commits cause tests to fail according to travis while all local tests run on all machines we test. The cause of this has generally been the problems mentioned. On Friday, October

Re: [nodejs] peeves current best practices?

2012-10-11 Thread Bradley Meck
Probably true especially regarding code complexity, but disk space is cheap. Though, the time to install all that stuff is a real bummer. If `npm install` was faster, would this be less of an issue? Disk is cheap, but if you actually do end up loading all the libraries at once you can

Re: [nodejs] NPM: How to install packages without compiling them

2012-10-11 Thread Bradley Meck
https://npmjs.org/doc/config.html#rebuild-bundle On Thursday, October 11, 2012 8:49:10 AM UTC-5, Mariusz Nowak wrote: Daniel, I think 'npm rebuild' may work for installation of already created bundle, but still what's missing is how to download all dependencies into correct folders without

Re: [nodejs] NPM: How to install packages without compiling them

2012-10-11 Thread Bradley Meck
Forgot to mention, bundle the dependencies on your build server. On Thursday, October 11, 2012 10:25:56 AM UTC-5, Bradley Meck wrote: https://npmjs.org/doc/config.html#rebuild-bundle On Thursday, October 11, 2012 8:49:10 AM UTC-5, Mariusz Nowak wrote: Daniel, I think 'npm rebuild' may work

Re: [nodejs] NPM: How to install packages without compiling them

2012-10-11 Thread Bradley Meck
bundle that was already prepared, but do you know the way how can I create such bundle? This is what I'm missing (!) :) On Thursday, October 11, 2012 5:26:24 PM UTC+2, Bradley Meck wrote: Forgot to mention, bundle the dependencies on your build server. On Thursday, October 11, 2012 10:25

Re: [nodejs] peeves current best practices?

2012-10-11 Thread Bradley Meck
Just beware of Travis CI failing for situations that are beyond your control. Missing C libraries, OS issues, and external resource needs can all be problematic. Also I have noted at least in the past sometimes travis fails to provision VMs appropriately. Running tests in your environment is

[nodejs] Re: Poll for v0.10 feature: Crypto default to 'binary' strings vs defaulting to buffers

2012-10-08 Thread Bradley Meck
a. who is actually messing with crypto after the fact. I would like to know the reasons to do so. On Monday, October 8, 2012 6:24:36 PM UTC-5, Isaac Schlueter wrote: Currently, the crypto module defaults to using 'binary' encoded strings everywhere as the default input and output encoding.

[nodejs] Re: Node.jar - Java port by Oracle

2012-10-04 Thread Bradley Meck
As long as NPM works, since it uses Node's module loader apparently, I am sure some horrible but interesting bridges will be crossed on the NPM registry. Looking forward to it. On Thursday, October 4, 2012 12:16:24 PM UTC-5, Jonathan Buchanan wrote: I'm at JavaOne, for my sins, and I've been

[nodejs] Re: A quest for a more accurate net.isIP() for IPv6

2012-10-04 Thread Bradley Meck
split is a fairly expensive operation, for the most part I would guess the regex compiler would do a better job and avoid GC fluff. Ugly though. http://jsperf.com/ipv4-regex -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Re: eventlocal and the need for a threadlocal like feature

2012-09-20 Thread Bradley Meck
Look into domains. You can just add a property to process.domain was something that was discussed at NodeConf summer camp. On Thursday, September 20, 2012 9:07:23 AM UTC-5, David Boon wrote: Forgive me for reviving this debate about threadlocals. Before anyone loses their heads, I'm not

[nodejs] Re: Threading, and Dogmatisms.

2012-09-16 Thread Bradley Meck
There are long discussions in the Node community about what happened when we did try to use Isolates. The lack of thread level protections from things like mucking with process.* and the fact that native modules need to add complex support for Isolates to be first class (many C level libraries

[nodejs] Re: Threading, and Dogmatisms.

2012-09-16 Thread Bradley Meck
the approach taken by threads a gogo. I am not against threading, just very cautious. On Sunday, September 16, 2012 6:11:48 PM UTC-5, rektide wrote: Thanks so much for the informative reply: that's a lot of things I don't know about! On Sunday, September 16, 2012 6:22:50 PM UTC-4, Bradley Meck

[nodejs] Unload entire module

2012-09-03 Thread Bradley Meck
How do people unload entire modules after they are done using them, we have some very long running apps we are trying to reduce the footprint on and unloading certain modules seems to be a good start. For example if we could eventually end up with something like: require.unload('nconf') after

[nodejs] Re: Feature poll: Do you use the clientError event?

2012-08-31 Thread Bradley Meck
3 Hook into .on('request') or .on('connection') if you want it, thats how i do it already. On Wednesday, August 29, 2012 6:07:23 PM UTC-5, Isaac Schlueter wrote: Do you use the clientError event? Please choose one: 1. Yes, I use it all the time. Please don't change it ever, thank you.

[nodejs] Re: possible in npm to force architecture?

2012-08-28 Thread Bradley Meck
try setting the `npm_config_arch` environmental variable to your desired architecture when spawning `npm`. Related Code: https://github.com/TooTallNate/node-gyp/blob/master/lib/node-gyp.js#L142 https://github.com/TooTallNate/node-gyp/blob/master/lib/configure.js#L235 On Tuesday, August 28, 2012

[nodejs] Re: Is npm 1.1.49 slightly broken for global installs on Windows?

2012-08-17 Thread Bradley Meck
I have heard of a different person with what sounds like a similar problem, but no idea how wide spread it is. On Friday, August 17, 2012 2:00:49 PM UTC-5, adrians wrote: With node 0.8.7 x64 (Windows 7), npm seems to not see global modules installed under userdir/npm/... It only seems to

  1   2   >