this looks very interesting to me :-) In theory, i would like to build my own "framework", composed of many awesome libraries, that make sense if orchestrated and evolve that over time, by switching out some for others when necessary or when new awesome libraries arrive...
but i figured, i have a hard time building something that some established frameworks offer, because i need more inspiration of how to solve certain things and what are the advantages of different approaches, thus how all the libraries should be used together in order to build solutions. *@your proposed libraries* Libraries used in combination, if looked at as a whole, have some usage philosophy of how to approach problems, which is not easy to see just from looking at the libraries. One can figure out if contemplating about all the libraries mentioned, but its not easy. Basically, what i am always looking for is a clue of the ways people use combinations of libraries to approach problems. *@my current approach - frontend* I'm regularly looking at all the libs, substack is building and using, to get a grasp on his philosophy of creating solutions and i remember how long it took me until i settled with *browserify* over alternatives... ...but its just one tiny part of the puzzle. currently i'm looking at *hyperboot* & *keyboot* for having an independent versioned frontend + i'm looking at *hyperglue*, *domjs* & *platesjs* for templating and a project called *atomify* to have some sense of how to do self contained reusable components. *@my current approach - backend* For the backend (deployment, scaling, management, ...) i'm for now going with *strongloop* (maybe i should rather use *sailsjs*?), even though i have some libraries here and there that i would like to explore, but its very hard to get a feeling about the bigger ideas and broader concepts of community members and how they choose certain libraries in order to build their "custom frameworks" and adapt them to their problems. 2014-12-22 18:05 GMT+01:00 Floby <[email protected]>: > Hello everyone, > > I have been writing and publishing tools and modules this year without > advertising much any of them. Most of them are related in some way to what > I do at work and all of them have been published as to be as general > purpose as possible. > Since publishing is always funnier with real life feedback, I decided to > make a list of the stuff I've been working on. > > Here is a list of things I've published and might be useful to you : > > *stream-stream* > > > A stream of streams in order to concatenate the contents of several > streams > > var ss = require('stream-stream');var fs = require('fs'); > var files = ['a.txt', 'b.txt', 'c.txt'];var stream = ss(); > > files.forEach(function(f) { > stream.write(fs.createReadStream(f)); > }); > stream.end(); > > stream.pipe(process.stdout); > > > *stream-write-read* > > > Write to a file, read when it's done > > var WriteRead = require('stream-write-read'); > var cache = WriteRead('/my/cache/folder/file'); > cache.createReadable().pipe(destination); > > source.pipe(cache); > > > *stream-sink* > > > Collect all data piped to this stream when it ends > Useful for testing purposes > > var sink = require('stream-sink'); > readable.pipe(sink()).on('data', function(data) { > // YAY! > }); > > > *stream-blackhole* > > > A silly writable stream eating all data > Useful when you need to consume a readable stream but don't care about its > data > > var blackhole = require('stream-blackhole');process.stdin.pipe(blackhole()); > > > *duplex-maker* > > > Create a duplex stream from a writable and a readable > > var writable = fs.createWriteStream('/to/write');var readable = > fs.createReadStream('/to/read'); > var duplex = DuplexMaker(writable, readable); > > > *ka-ching* > > > Caching framework for streams > ka-ching is one of these larger projects that all of the others come from. > It can do many things and is mostly functional. It still needs some > polishing and battle testing though. > > var kaChing = require('ka-ching')('/path/to/cache/dir');var request = > require('request'); > > kaChing('my-cached-resource-id', function () { > return request('http://google.com/'); > }).pipe(destination); > > > > *cache-depend* > > Utility functions to detect when you should invalidate your cached data > > var onDate = require('cache-depend') > .date('2015-06-23 12:36:00') > > onDate.on('change', function (changeinfo) { > changeinfo.changeId > changeinfo.startedAt > changeinfo.endedAt > // Same here > }) > var onOthers = require('cache-depend') > .others(onEtag, onDate) // any number of arguments > > onOthers.on('change', function (changeinfo) { > changeinfo.changeId // is the same as the one emitted by the first to change > changeinfo.changed // reference to the changing dependency > }) > > > > *stream-json-stringify* > > > JSON.stringify, streaming, non-blocking > Still has some inconsistencies with the behaviour of JSON.stringify in > some edge cases but this is being worked on > > var stringify = require('stream-json-stringify'); > stringify(myBigObject).pipe(process.stdout); > > > > *object-iterator* > > > a module to walk through an object with an iterator > > var oi = require('object-iterator');var source = [8, {one: 1, yes: true}, > null];var next = oi(source);var v;while(v = next()) { > console.log(v.type); > } > // array// number// object// number// boolean// end-object// null// end-array > > > *url-assembler* > > > assemble URLs from route-like templates (/path/:param) > > UrlAssembler('https://api.site.com/') > .prefix('/v2') > .segment('/users/:user') > .segment('/projects/:project_id') > .segment('/summary') > .param({ > user: 'floby', > project_id: 'node-url-assembler' > }) > .toString() > > // => 'https://api.site.com/users/floby/projects/node-url-assembler/summary' > > > *http-measuring-client* > > > Like the http module, except with stats > Drop-in replacement for http/https modules. Can also monkey-patch the > native modules if necessary > > var http = require('http-measuring-client').create(); > http.get('http://google.com', function (response) { > // `response` is your plain old response object > }); > > http.on('stat', function (parsedUri, stats) { > // `parseUri` is parsed with url.parse(); > stats.totalTime; // -> total time taken for request > }) > > > *disect* > > > Bisection helper for javascript > > disect([10, 20, 30], function(element, index) { > return element > 11; > })// returns 20 > > > *crossroad* > > > Semantically-versionned service discovery > This one is my latest work in progress and is therefore not yet > functional, but is evolving very quickly > > the main design principles are > > - one sidekick process running per host (agent) > - gossip between agents to synchronise running services > - HTTP is the communication protocol > - The client is your regular HTTP client > - Proactive and Reactive consumption from clients > > GET /services/my-web-service/~1.0.1 > Host: localhost:5555 > Accept: application/json > > -> 200 OK > -> Content-Type: application/json > -> > -> { > -> "type": "my-web-service", > -> "uuid": "my-web-service-bd80ddff76e8ae5", > -> "version": "1.0.3", > -> "location": { > -> "host": "172.50.60.22", > -> "port": 8080 > -> } > -> } > > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > 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 unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/de57607a-f2db-4f00-9c43-2a1e8ad4962a%40googlegroups.com > <https://groups.google.com/d/msgid/nodejs/de57607a-f2db-4f00-9c43-2a1e8ad4962a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAN5%2BLUsAQVbejs2RSQQyJ%3D1E%3DqVCf6ghQrO%3DanKL1SND62yURQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
