[nodejs] Re: Hosting of Application in Europe

2014-11-08 Thread Mariusz Nowak
Get dedicated server on e.g. Hetzner (see http://www.hetzner.de/en/hosting/produktmatrix/rootserver ) they provide cheap an excellent service, and you can add additional disk when you need it. On Saturday, November 8, 2014 12:18:46 AM UTC+1, Markus Kuhn wrote: > > Hi Everybody, > > i found som

Re: [nodejs] Re: Bundle it all into one single js file

2014-03-06 Thread Mariusz Nowak
On Thursday, March 6, 2014 9:52:41 AM UTC+1, Axel Kittenberger wrote: > > Yes I tried. The resulting script will fail on execution with "Error: > Could not find module 'fs'" > Indeed, it will create a bundle, but internally in bundle there's no fallback to native Node's require, so it can't w

Re: [nodejs] Re: Bundle it all into one single js file

2014-03-06 Thread Mariusz Nowak
On Thursday, March 6, 2014 9:41:09 AM UTC+1, Axel Kittenberger wrote: > > webmake looks good, but I cannot get it to simply leave require( 'vs' ) > and require( 'vm' ) native node include as they are. > Have you tried --ignore-errors option? It will still warn you about it, but bundle will be

[nodejs] Re: Bundle it all into one single js file

2014-03-02 Thread Mariusz Nowak
Any bundle, produced with good CJS bundler, should be runnable also on server side, as e.g. `node bundle.js`, For sure it does with Webmake (I'm the author) -> https://github.com/medikoo/modules-webmake#modules-webmake Do you know of a tool that takes a js file as entry point and bundles all >

[nodejs] Re: [ANNC] Node Inspector v0.7 is out - here's what's new...

2014-02-26 Thread Mariusz Nowak
That's great news. Thanks! On Tuesday, February 25, 2014 6:49:15 PM UTC+1, Jimmy Guerrero wrote: > > Hello, > > Whether you are new to debugging Node apps or have used Node Inspector in > the past, it's time to check out what's new in the latest v0.7 release of > Node Inspector! > > It's been a

[nodejs] Re: Which promises library to use?

2014-02-15 Thread Mariusz Nowak
@Ian L. for strictly polyfill there are two options, first is `es6-promise`: https://github.com/jakearchibald/es6-promise and second is `es6-shim` https://github.com/paulmillr/es6-shim which includes now Promise polyfill. Still, I'd advise to hold your horses, and stick with one of the popular

[nodejs] Re: Announcing European npm mirror

2013-11-16 Thread Mariusz Nowak
Maciej, and how up to date is European mirror. If I publish new package or new version of a package, can it be right away installed via mirror? On Friday, November 15, 2013 6:03:21 PM UTC+1, Maciej Małecki wrote: > > All! > > Today I finished setting up the European npm mirror. It is now availab

Re: [nodejs] node.js and promise

2013-10-21 Thread Mariusz Nowak
yAsyncFunction().then(function () { console.log("promise is working"); > }); > > > > myAsyncFunction().then(function () { console.log("it really worked"); }); > > ^ > > > TypeError: Cannot call method 'then' of un

Re: [nodejs] node.js and promise

2013-10-21 Thread Mariusz Nowak
On 21 paź 2013, at 19:52, Reza Razavipour wrote: > we all of this I still can not figure out how to take an async function and > change it from callback to a promise. Many libraries provide it's own utils for that, just check their documentation: https://github.com/kriskowal/q#adapting-node

[nodejs] Re: node.js and promise

2013-10-19 Thread Mariusz Nowak
Reza, check this before and after example: https://github.com/medikoo/deferred#plain-nodejs-callbacks-approach and once I tried explain promises to newcomers with following slides: http://www.medikoo.com/asynchronous-javascript/ it's nearly two years old, but still mostly up to date. Maybe that

[nodejs] Re: Best practices managing node dependencies?

2013-08-14 Thread Mariusz Nowak
There was already discussion on that: https://groups.google.com/d/msg/nodejs/Dj8QZ-5qHoM/91ngmxr0NHsJ My approach is following: For generic packages: Never include node_modules within .git, just maintain well configured package.json For final projects: Include all content of node_modules withi

[nodejs] Re: JS or node? require("http://scripthost/myModule.js");

2013-06-12 Thread Mariusz Nowak
On Tuesday, June 11, 2013 9:49:43 PM UTC+2, nos...@hoodel.com wrote: > > > I'm reading JavaScript on the Server Using Node.js and Express. Having > just read the chapter on modules, it seems overly restrictive to make > require() refer only to files. It seems to me that a hosted module server

[nodejs] v0.10 big performance issue (not observable with v0.11)

2013-05-29 Thread Mariusz Nowak
aware of such issue? Do you know what's the cause? Is it issue of V8 or rather some Node.js layer? Is there a plan to fix it in v0.10, or it will stay with v0.10, but will be fixed with stable. v0.12 release? Thanks! Mariusz Nowak -- -- Job Board: http://jobs.nodejs.org/ Posting

[nodejs] v0.10 big performance issue (not observable with v0.11)

2013-05-29 Thread Mariusz Nowak
ng, so it can't be the case that querystring became more performant. My question is, are you (Node.js maintainers) aware of such issue? Do you know what's the cause? Is it in V8 or rather some Node.js layer? Is there a plan to fix it for v0.10 or it will stay with v0.10, but will be f

[nodejs] Re: EMFILE issues

2013-05-13 Thread Mariusz Nowak
As an aid for EMFILE errors I once came up with this -> https://github.com/medikoo/fs2/#descriptorshandler It works like a charm, and prevents EMFILE errors whichever affecting function you use, (even fs.watch if you use fs2 watch functionalities) I wouldn't just advertise to load it within gene

[nodejs] Re: Our Contribution To Node Community, Introducing NodeJS Console

2013-05-05 Thread Mariusz Nowak
It's really nice, to be really serious misses just two things: 1. Should run latest Node.js (Currently it runs v0.8.21 which is not great) 2. Provide access to NPM modules. This could be done just by providing option to do "npm install" after edition of "package.json" and then exposing "node_mo

[nodejs] Re: Retrieving values asynchroniously

2013-04-23 Thread Mariusz Nowak
Take a look into promises concept. e.g. with Deferred library you can configure it that way: deferred(Object1.retrieveNum1(), Object1.retrieveNum2(), Object1.retrieveNum3()).match(function (num1, num2, num3) { var result = (num1 + num2) / num3; }); On M

Re: [nodejs] Gemnasium, now with NPM support

2013-02-14 Thread Mariusz Nowak
.tech-angels.com > main : +33 (0) 970 444 643 > mobile : +33 (0) 6 72 63 75 40 > fax : +33 (0) 9 72 12 78 75 > > > > On Thu, Feb 14, 2013 at 3:28 PM, Philippe Lafoucrière < > philippe.l...@tech-angels.com > wrote: > >> >> On Thu, Feb 14, 2013 at 2:58 PM,

Re: [nodejs] Gemnasium, now with NPM support

2013-02-14 Thread Mariusz Nowak
What changelog "standard" do you support? I provide changelog with my package, but It's not provided within gemnasium, see e.g. https://gemnasium.com/npms/cli-color/ and https://github.com/medikoo/cli-color/blob/master/CHANGES Other important note, you treat names case insensitive, which is rig

Re: [nodejs] a pakage that exports few modules

2013-01-24 Thread Mariusz Nowak
I'm also getting confused, but still I'm after simplicity and rather happy that 'directories' are not supported any more. Isaac do you see any semantics in 'lib' folder? Do you feel that some modules should rather be placed in 'lib' than at 'root' fo the package (or other way) or it's totally "

[nodejs] Re: How to revive a dead npm module?

2013-01-01 Thread Mariusz Nowak
I guess that about 50% of projects in npm reflect such state. It would be good if npm have some better procedures for that, like allow to retake the name, and give rights to publish greater versions. On Monday, December 31, 2012 2:18:31 PM UTC+1, toranb wrote: > > A few months back I took on a d

[nodejs] Re: Checking node_modules into git

2012-12-27 Thread Mariusz Nowak
This is good approach, but only for final applications, you should never commit dependencies into repositories of resuable (generic) modules. I have great experience with that, and to me it's the *only* way to assure that installation of application is straightforward and the only way to make s

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

2012-11-12 Thread Mariusz Nowak
If I would choose which tool is best for my project just by popularity factor I wouldn't go far. It's understood that Async is more popular as it doesn't introduce much learning factor and most developers are looking for quick solutions. To get promises you need to devote a while understand it.

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

2012-10-11 Thread Mariusz Nowak
rs > most cases (wont set env variables when spawning npm and such so > rebuild-bundled will have to be set when you `npm i` on any other server if > it has install scripts that need running even if it was bundled). > > On Thursday, October 11, 2012 12:19:56 PM UTC-5, Mariusz N

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

2012-10-11 Thread Mariusz Nowak
ndencies 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,

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

2012-10-11 Thread Mariusz Nowak
asiest way to achieve what you want to do is by using > the "npm rebuild" command. > > -- Daniel R. > [http://danielr.neophi.com/] > > > > On Thu, Oct 11, 2012 at 6:06 AM, Mariusz Nowak > > > wrote: > > I'd like to create application bundle

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

2012-10-11 Thread Mariusz Nowak
I'd like to create application bundle with all it's dependencies, so it can be installed on any platform without need of internet connection (other case is that it shouldn't be dependent on npm repository state - let's say I want to be sure I can install it without issues in 5 years time). So t

[nodejs] Re: "node_modules" for private modules that need to be committed?

2012-10-11 Thread Mariusz Nowak
Tom: Have you tried following in .gitignore: node_modules/* !node_modules/my-private-package1 !node_modules/my-private-package2 On Wednesday, October 10, 2012 5:09:27 PM UTC+2, Tom wrote: > > I've added the node_modules folder to my .gitignore file, which works fine > thanks to NPM Shrinkwrap

Re: [nodejs] Does fs.chmod have any effect on Windows platform?

2012-10-09 Thread Mariusz Nowak
Thanks, that clarifies. I understand that is also works for files only? at least I think there's no effect when trying to change bits for directories (?) On Tuesday, October 9, 2012 4:14:05 PM UTC+2, Ben Noordhuis wrote: > > On Tue, Oct 9, 2012 at 4:03 PM, Mariusz Nowak &

[nodejs] Does fs.chmod have any effect on Windows platform?

2012-10-09 Thread Mariusz Nowak
fs.lchmod is only available on OSX, while fs.chmod is available on all platforms still it seems to have no effect on Windows. Is it just noop there? Or it has some effect in some cases? If anyone knows the answer I'll be grateful. Thanks. -- Job Board: http://jobs.nodejs.org/ Posting guidelines

Re: [nodejs] Re: [ANN]: Deferred - Maintainable asynchronous JavaScript with promises

2012-10-04 Thread Mariusz Nowak
On Thursday, October 4, 2012 9:39:43 AM UTC+2, Domenic Denicola wrote: > > > On Thursday, October 4, 2012 7:55:50 AM UTC+2, Mikeal Rogers wrote: >> >> Domains work OOTB on all event emitters but have some complications with >> callbacks and streams. >> >> Streams that are long running (like the

Re: [nodejs] Re: [ANN]: Deferred - Maintainable asynchronous JavaScript with promises

2012-10-04 Thread Mariusz Nowak
Mikeal, thanks, that's a very valuable guideline. I haven't yet look deeply into domains, now I definitely would. On Thursday, October 4, 2012 7:55:50 AM UTC+2, Mikeal Rogers wrote: > > I agree with the principal that you shouldn't shove all your control flow > through event emitters, but I'd ta

Re: [nodejs] Re: [ANN] promise-stream: Turn a stream into a commonJS promise

2012-10-03 Thread Mariusz Nowak
> , d = require("domain").create() >> >> d.run(function () { >> chain(DirStream(__dirname)) >> .filter(function (fileName) { >> return (file.slice(-3) === ".js" && (file !== "lib.js")) >> })

[nodejs] Re: [ANN] promise-stream: Turn a stream into a commonJS promise

2012-10-03 Thread Mariusz Nowak
Raynos, I have a feeling that you are comparing apples and oranges. Streams are awesome, Promises are awesome but it's not the same, and not every use case can be addressed on equal level by both of them. >From my experience there can be promises that are also a streams, but among them are also

[nodejs] Re: [ANN]: Deferred - Maintainable asynchronous JavaScript with promises

2012-10-03 Thread Mariusz Nowak
Didn't know about that one, that's indeed big flaw, jQuery's solution is far from complete. On Wednesday, October 3, 2012 4:18:42 AM UTC+2, Domenic Denicola wrote: > > jQuery promises also aren't interoperable with other promise-consuming > libraries, because they do not transform errors thrown

[nodejs] Re: [ANN]: Deferred - Maintainable asynchronous JavaScript with promises

2012-10-02 Thread Mariusz Nowak
Jeff, I think you're talking about different implementation: https://npmjs.org/package/Deferred it's still at v0.1.1 and in fact it resembles jQuery's Deferred. It was published later on npm with same name but uppercased (Today npm wouldn't allow that ;) For Deferred (one that opened this topic

[nodejs] Re: [ANN]: Deferred - Maintainable asynchronous JavaScript with promises

2012-10-02 Thread Mariusz Nowak
Domenic, I'll be very happy to join. Where exactly you're discussing it? Q mailing list? On Tuesday, October 2, 2012 3:32:13 PM UTC+2, Domenic Denicola wrote: > > > > On Monday, October 1, 2012 3:46:19 PM UTC-4, Mariusz Nowak wrote: >> >> >> In Deferred

[nodejs] Re: [ANN]: Deferred - Maintainable asynchronous JavaScript with promises

2012-10-01 Thread Mariusz Nowak
Jeff, Surprisingly I didn't know that one, I've added it to benchmarks, it turned out to be slower than jQuery's implementation, and what's weird and disturbing is that running concurrent calls using When is slower than queued calls one after another: https://github.com/medikoo/deferred#perfor

[nodejs] Re: [ANN]: memoizee - Complete memoize/cache solution

2012-09-24 Thread Mariusz Nowak
It can be easily implemented > in async mode. That has 2 benefits: > - no freezes on expires > - easy to avoid parallel refresh requests > > Vitaly. > > среда, 19 сентября 2012 г., 2:06:21 UTC+4 пользователь Mariusz Nowak > написал: >> >> https://github.com/

[nodejs] [ANN]: Deferred - Maintainable asynchronous JavaScript with promises

2012-09-22 Thread Mariusz Nowak
Deferred is (another) promise solution for Node.js (and JavaScript in general). Originally inspired by Q, however more weight is put on functional capabilities of JavaScript and in result many things are solved differently. Everything is well documented at https://github.com/medikoo/deferred.

[nodejs] Re: [ANN]: memoizee - Complete memoize/cache solution

2012-09-21 Thread Mariusz Nowak
. > > For many things, the max option would be fine, but just for completeness > (and a very popular use case), it would be great to have a LRU option. > > Just my thoughts for completing out the feature set. I think your project > is great none the less. > > Jeff > &

[nodejs] Re: Keeping semantics in your version numbers, i.e. please don't release major version zero

2012-09-20 Thread Mariusz Nowak
Austin, version v0.x doesn't mean that project is not *stable*, in my point of view everything published on npm should be stable (unstable should just stay on github, or be published under different dedicated minor version, like node does: even numbered stable, odd numbered experimental) Versio

[nodejs] Re: [ANN]: memoizee - Complete memoize/cache solution

2012-09-19 Thread Mariusz Nowak
Jeff, It can easily be ported to browser with help of Webmake https://github.com/medikoo/modules-webmake (it's mentioned in documentation) Anyway to make it even easier I prepared a bundle -> https://github.com/medikoo/memoize/downloads ;) According to LRU option, you can achieve it with 'max'

[nodejs] [ANN]: memoizee - Complete memoize/cache solution

2012-09-18 Thread Mariusz Nowak
https://github.com/medikoo/memoize npm install memoizee For one of my projects I needed memoizer, that would be both fast and would work with any type of input arguments. Other projects demanded other common functionalities, so it's result of real world needs I approached in last months. To ma

[nodejs] Re: Weird problems with module.exports

2012-09-07 Thread Mariusz Nowak
Within Node.js such issue may occur *only* when your dealing with cyclic dependencies. If it's the case just move require's to modules in question to end of the file (after assignment to module.exports), it will fix that. You say it's Travis error, so maybe it's the case of circular dependencies

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

2012-09-01 Thread Mariusz Nowak
4 On Thursday, August 30, 2012 1:07:23 AM UTC+2, 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. > > 2. I don't use it, but I'm aware of it, and I think I might someday. > > 3. I don

Re: [nodejs] Best practices for sharing code and data between the server and client

2012-08-13 Thread Mariusz Nowak
to integrate with AMD modules and tools. Just something > to consider. > > > I like the elegance of your approach, seems to really make things easy. I > will have to give it a try soon. > > All the best, > > Jeff > > On Monday, 13 August 2012 05:36:38 UTC-5, Mariusz Now

Re: [nodejs] Best practices for sharing code and data between the server and client

2012-08-13 Thread Mariusz Nowak
le modules and 60% of those modules are also used on server-side. -- Mariusz Nowak http://github.com/medikoo http://twitter.com/medikoo On Saturday, June 2, 2012 3:20:29 PM UTC+2, al-Amjad Tawfiq Isstaif wrote: > > Thank you very much everybody for your notes! > > @Martin > I tri

Re: [nodejs] Node v0.8.6 on Mac OS X Mountain Lion crashing

2012-08-10 Thread Mariusz Nowak
oss > Christian / SpanDeX, Inc. / BA of Computer Science, UW-Madison 2013 > 414-377-1041 / http://www.joshisgross.com / http://www.spandex.io > > > > On 10 August 2012 06:56, Mariusz Nowak >wrote: > >> On my side it's plain Node.js and strictly JavaScript module

Re: [nodejs] Node v0.8.6 on Mac OS X Mountain Lion crashing

2012-08-10 Thread Mariusz Nowak
On my side it's plain Node.js and strictly JavaScript modules. It started to happen when I started to close fs watchers on the way. Errors happen at random times, and when I tried to narrow it. I found out that they happen on calls to fs.writeFile (or other functions that do changes to file sys

[nodejs] Re: Node v0.8.6 on Mac OS X Mountain Lion crashing

2012-08-10 Thread Mariusz Nowak
I have same issue when I do a lot of writes and reads to files and additionally I'm using a lot of watchers. However I'm not sure whether it affects just OSX 10.8, anyway it surely affects just OSX. I've looked on the web and in most sources it is said it's a OS issue not Node.js, I hope though

[nodejs] Re: How to fork child in "non persistent" way?

2012-08-02 Thread Mariusz Nowak
it and didn't remove it: var watch = require('fs').watch(__dirname, { persistent: false }, function (event) { // Process event }); I wonder if similar setup would be possible with process communication. -- Mariusz Nowak http://github.com/medikoo http://twitter.com/medikoo

Re: [nodejs] Re: How to fork child in "non persistent" way?

2012-07-31 Thread Mariusz Nowak
Node, without blocking exit of main process? -- Mariusz Nowak http://github.com/medikoo http://twitter.com/medikoo > > > Anyway I decided that what I wanted to achieve is not clean, creating > > background processes in generic modules is not great, and I gone other > path, >

[nodejs] Re: How to fork child in "non persistent" way?

2012-07-31 Thread Mariusz Nowak
and this: https://github.com/joyent/node/issues/3799 it looks this behavior may change in close future :) On Tuesday, July 31, 2012 9:53:01 AM UTC+2, Mariusz Nowak wrote: > > Accidentally I just found very related issue > https://github.com/joyent/node/issues/2605 > > On Tuesday

[nodejs] Re: How to fork child in "non persistent" way?

2012-07-31 Thread Mariusz Nowak
Accidentally I just found very related issue https://github.com/joyent/node/issues/2605 On Tuesday, July 31, 2012 9:15:14 AM UTC+2, Mariusz Nowak wrote: > > @Jeff If you're handling not detached child processes process will never > 'exit' naturally, so waiting for &#

[nodejs] Re: How to fork child in "non persistent" way?

2012-07-31 Thread Mariusz Nowak
ean itself up. > If you need to do any cleanup on the parent after the child has closed > then wait on a final message from the child saying > its done. The details for you maybe be different, but this is the general > idea. > > Jeff > > On Friday, July 27, 2012 9:00:19 AM UTC

[nodejs] How to fork child in "non persistent" way?

2012-07-27 Thread Mariusz Nowak
I'd like to create fork (via child_process.fork) and make both master and child exit after all tasks in master process are done. When I do: var child = child_process.fork("foo.js"); Process just hangs. I can of course exit it manually via `process.exit`, but it's a generic module, and I don't h

[nodejs] Re: Node.js + Instagram Real-time API

2012-07-26 Thread Mariusz Nowak
Is it on Github somewhere? I'd like to see similar project for other cities :) On Wednesday, July 25, 2012 4:34:09 AM UTC+2, Marcio Puga wrote: > > Sydney-now was built with love using the extraordinary combination of > Node.js + Socket.io and the > rea

[nodejs] Re: Seq parEach

2012-07-20 Thread Mariusz Nowak
I won't help you with Seq, but it looks as pretty easy case for other concept I'm familiar with, check: https://gist.github.com/3149506 I'm not sure how you want to fetch md5 and servers info so I just hidden that logic between fetchMd5 and fetchServers functions. On Thursday, July 19, 2012 7:

[nodejs] Re: Emacs

2012-07-13 Thread Mariusz Nowak
Ruquay, I've once created not invasive fix for js2-mode to properly highlight json files, see http://code.google.com/p/js2-mode/issues/detail?id=50#c7 -- Mariusz Nowak http://github.com/medikoo http://twitter.com/medikoo On Friday, July 13, 2012 8:47:53 AM UTC+2, Ruquay Calloway wrote:

[nodejs] Re: Emacs

2012-07-12 Thread Mariusz Nowak
Here's my .emacs.d https://github.com/medikoo/emacs-starter I don't use anything Node specific, just slightly modified js2-mode for highlighting js and json files. On Thursday, July 12, 2012 2:59:25 PM UTC+2, Mihamina Rakotomandimby wrote: > > Hi all, > > Just for curiosity, who's using Emacs

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Mariusz Nowak
gs.h1; ... " > c2) > var st = require('simpletags'); > eval(st.exportLocalCode('st')); // the local variable name 'st' should be > informed to be used in var ...= string result > > On Sat, Jul 7, 2012 at 10:38 AM, Mariusz Nowak wrote: >

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Mariusz Nowak
ng regular require/export logic to share objects between modules, you're doing something wrong. Try to think just with require/exports and then you should quickly find way home. See how module relations in other packages work. -- Mariusz Nowak https://github.com/medikoo http://twitter.c

[nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Mariusz Nowak
@ajlopez get to know how variable scoping in JavaScript works (what is global, how this and how local variable works), and you'll get the answers :) On Saturday, July 7, 2012 2:11:56 PM UTC+2, ajlopez wrote: > > Hi people! > > A very simple question. When I write in the Node repl: > > this.foo

[nodejs] Re: XML DOM Libraries

2012-07-06 Thread Mariusz Nowak
Other thing you may check is https://github.com/tmpvar/jsdom it's very popular but unfortunately it's not pure JavaScript. On Friday, July 6, 2012 12:17:24 AM UTC+2, Alan Gutierrez wrote: > > I'd like to parse XML and manipulate it on the server using W3C XML DOM, > so that > the code can be sh

[nodejs] Re: XML DOM Libraries

2012-07-06 Thread Mariusz Nowak
+1 All other language environments have neat XML DOM implementations, and Node.js still hasn't, I also strongly miss that. xmldom looks interesting. If you'll find any other good solutions let us know. On Friday, July 6, 2012 12:17:24 AM UTC+2, Alan Gutierrez wrote: > > I'd like to parse XM

[nodejs] Re: Parallel Async Calls and Parallel Errors

2012-07-06 Thread Mariusz Nowak
You definitely should report with one error object, and you won't find function in Node.js API that returns more than one error. Most straightforward way would be to fail your function as soon as first error occurs, and report with that error. However if you'd like to have more complete solutio

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

2012-07-01 Thread Mariusz Nowak
back ;-) I've once done introduction to promises speech. See http://www.medikoo.com/asynchronous-javascript/ (promises starts at 16 slide) -- Mariusz Nowak https://github.com/medikoo http://twitter.com/medikoo On Sunday, March 25, 2012 10:42:32 AM UTC+2, Andy wrote: > > *Note,

[nodejs] Re: Closures versus Prototypes for Flow Control

2012-06-21 Thread Mariusz Nowak
Alan, we use asynchronous programming for tasks that take time, so in that case, whether we wrap such tasks with closure or prototype solution wouldn't make difference in performance. I think debating on performance in that case is pointless. As a side node be sure to check also deferred/promis

[nodejs] Re: nowjs - Error: Cannot find module 'now'

2012-06-02 Thread Mariusz Nowak
It looks that node is working properly but 'now' package is not installed. Are you sure you've installed it with "npm install -g now" ? -- Mariusz Nowak https://github.com/medikoo http://twitter.com/twitter On Saturday, June 2, 2012 2:36:22 PM UTC+2, Chris994 wrote:

Re: [nodejs] Re: Callback Style Preference

2012-05-31 Thread Mariusz Nowak
@Oliver Synchronous functions throw errors if there's any, they do not take any callback for that. On Thursday, May 31, 2012 9:22:05 PM UTC+2, Oliver Leics wrote: > > On Thu, May 31, 2012 at 9:15 PM, Mariusz Nowak > wrote: > > @Oliver createServer is not asynchro

Re: [nodejs] Re: Callback Style Preference

2012-05-31 Thread Mariusz Nowak
@Oliver createServer is not asynchronous function, it is synchronous function that returns event emitter and optionally accepts listener. It's different concept/pattern and all rules are followed On Thursday, May 31, 2012 9:08:03 PM UTC+2, Oliver Leics wrote: > > On Thu, May 31, 2012 at 8:08 PM

Re: [nodejs] Re: Callback Style Preference

2012-05-31 Thread Mariusz Nowak
+1 I looked at the Node's source, and indeed path.exists (to be fs.exists) is just wrapper over fs.stat. If there's no "lighter" way for checking whether path exists, indeed it's best it it's not in the API at all. There are already two good reasons for that: it encourages bad practices and it

[nodejs] Re: Callback Style Preference

2012-05-30 Thread Mariusz Nowak
ed to pass success value as first argument (in case of path.exists true or false). -- Mariusz Nowak - @medikoo On Wednesday, May 30, 2012 3:24:06 AM UTC+2, Daniel R. wrote: > > Is there consensus on the value to pass to a callback if there isn't > an error and there may or may not

[nodejs] Re: FN.bind vs fn() { FN() }

2012-05-29 Thread Mariusz Nowak
Use what works for you, and don't bother with premature optimization. By the way it's not greatest bind use case, I wouldn't use bind here. In some older versions of node (v0.6.3 ?) , setTimeout passes one argument to the callback, and in your example it will be logged as well. On Tuesday, May

[nodejs] Re: recommended flow control library?

2012-05-27 Thread Mariusz Nowak
Be sure to check also: https://github.com/medikoo/deferred a very *functional* promise/deferred concept implementation. On Saturday, May 26, 2012 8:54:13 PM UTC+2, Davis Ford wrote: > > There does not appear to be a shortage of libraries out there that help > with flow control. I'm looking for

[nodejs] Re: Sharing code between client and server

2012-05-15 Thread Mariusz Nowak
It's rather JavaScript question, you should do: if (typeof goog !== 'undefined') { On Tuesday, May 15, 2012 12:41:47 PM UTC+2, Robert Chris Bang Larsen wrote: > > Thanks for all the suggestions. I tried detecting which environment I was > in but it didn't work. > > We have built a couple of sin

[nodejs] Re: Sharing code between client and server

2012-05-10 Thread Mariusz Nowak
https://github.com/medikoo/modules-webmake It works, it's fast, Currently I'm building all client/server web applications with that (on average I have 60% of modules shared between server and client) On Tuesday, May 8, 2012 11:05:26 AM UTC+2, Robert Chris Bang Larsen wrote: > > Hi all > > I am

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Mariusz Nowak
rkout/learn solution that will feel comfortable with. -- Mariusz Nowak https://github.com/medikoo http://twitter.com/medikoo On Wednesday, April 11, 2012 11:24:15 AM UTC+2, Isaac Schlueter wrote: > > Trying stuff out is great. Do that. > > Also, you should learn JavaScript. It's

[nodejs] Re: How to avoid callback hell?

2012-04-10 Thread Mariusz Nowak
ll(db, ...); fooCollection = db.invokeAsync('collection', ); fooItems = fooCollection.invokeAsync('query', ..); That's the way I work with mongodb driver for Node.js, if you find this attractive check https://github.com/medikoo/deferred -- Mariusz Nowak https://github.com/medi

[nodejs] Re: Request for feedback- Yet another client-side module loader (it's different, I promise:))

2012-03-27 Thread Mariusz Nowak
Guys, check https://github.com/medikoo/find-requires -- Mariusz Nowak https://github.com/medikoo http://twitter.com/medikoo On Tuesday, March 27, 2012 10:26:32 AM UTC+2, Bruno Jouhier wrote: > > Same way you do it: regexp > > On Monday, March 26, 2012 9:49:28 PM UTC+2, meelash wrot

[nodejs] Re: Control over 'require' logic

2012-02-16 Thread Mariusz Nowak
@Tomasz Node.js doesn't allow easy customization of Module functionality, it's basically internal. You also need to be aware that internal API may change even between minor versions (e.g. one of my modules stopped working from v0.6.10 because it relied on internal function). For such specific

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

2012-02-10 Thread Mariusz Nowak
but I'm afraid it will largely affect performance and we don't need full AST tree just for picking requires. Now I'm thinking rather about dedicated script which only purpose would be to walk the code and pick up requires. I've done once similar thing in python, it wouldn

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

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