00:00:05  <ljharb>and then you could use it with react
00:00:14  * ozcanesenjoined
00:01:50  * rohanrhujoined
00:01:50  <ljharb>i look forward to seeing your innovative approach to global event/state management
00:03:46  * scippiojoined
00:04:35  * graffixquit (Ping timeout: 240 seconds)
00:04:40  * humanBirdquit (Ping timeout: 260 seconds)
00:05:25  <deltab>mscdex: thanks! (you updated the version, I presume)
00:05:25  * s2013joined
00:06:40  * goodenoughquit (Remote host closed the connection)
00:06:52  * troykellyjoined
00:08:23  * munch_quit (Remote host closed the connection)
00:08:49  * amdi_quit (Ping timeout: 246 seconds)
00:09:22  * Cabanossiquit (Ping timeout: 264 seconds)
00:09:26  * compexjoined
00:10:11  * Cabanossijoined
00:10:12  * a_thakurquit (Read error: Connection reset by peer)
00:10:16  * alibbyquit (Read error: Connection reset by peer)
00:10:22  * alibby1joined
00:10:37  * a_thakurjoined
00:10:53  * \mSgquit (Read error: Connection reset by peer)
00:11:25  * Rodya_joined
00:11:25  * ispnquit (Quit: fgsfds)
00:12:42  * plutoniixjoined
00:12:52  * plutoniixquit (Max SendQ exceeded)
00:13:54  * graffixjoined
00:14:02  * graffixpart
00:14:40  * plutoniixjoined
00:14:43  * wrkrcoopquit (Quit: wrkrcoop)
00:14:47  * EricBladequit (Quit: Leaving.)
00:15:49  * Rodya_quit (Ping timeout: 246 seconds)
00:16:52  * hextileXquit (Quit: hextileX)
00:17:26  * planiganjoined
00:17:50  * ozcanesenquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:17:56  * dajkiriquit (Ping timeout: 256 seconds)
00:18:19  * hreinnbeckquit (Ping timeout: 268 seconds)
00:19:01  * ikcerogjoined
00:19:01  * ikcerogquit (Client Quit)
00:19:57  * Rodya_joined
00:20:07  * LeBlaaancjoined
00:20:52  * _oslobystorm_joined
00:21:59  * EricBladejoined
00:22:53  * milardov_joined
00:23:10  * milardovichquit (Ping timeout: 264 seconds)
00:23:35  * oslobystormquit (Ping timeout: 240 seconds)
00:24:35  * Narigoquit (Quit: This computer has gone to sleep)
00:25:10  * neoncontrailsjoined
00:25:16  * ivan_the_monkeyjoined
00:25:58  * Narigojoined
00:28:27  * cootjoined
00:31:11  <mscdex>deltab: huh?
00:32:02  <deltab>yesterday someone pointed out the version numbers in the topic were outdated
00:32:33  * hreinnbeckjoined
00:33:22  * ivan_the_monkeyquit (Ping timeout: 264 seconds)
00:34:36  * promethquit (Quit: My Mac Mini has gone to sleep. ZZZzzz…)
00:35:52  * planiganquit (Quit: leaving)
00:37:20  * orbyt_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:37:35  * sqramquit (Quit: WeeChat 1.7)
00:39:56  * a_thakurquit (Remote host closed the connection)
00:40:27  * a_thakurjoined
00:41:03  * phutchinsjoined
00:41:04  * planiganjoined
00:41:35  * melvsterquit (Ping timeout: 240 seconds)
00:42:27  * conmaxojoined
00:43:02  * brent__quit (Remote host closed the connection)
00:43:31  * charlenopiresjoined
00:44:25  * kaylinedjoined
00:44:27  * notdanielquit (Quit: Leaving)
00:44:28  * a_thakurquit (Ping timeout: 240 seconds)
00:44:54  * frankdreyjoined
00:45:05  * \mSgjoined
00:45:36  * cootquit (Quit: coot)
00:45:53  * KermitoniTjoined
00:49:01  * Narigoquit (Quit: This computer has gone to sleep)
00:49:25  * chippingquit (Ping timeout: 246 seconds)
00:50:33  * rangergordjoined
00:51:06  * chippingjoined
00:51:38  * planiganquit (Ping timeout: 260 seconds)
00:51:40  * EricBladequit (Quit: Leaving.)
00:51:48  * AdolphusGustavusquit (Ping timeout: 240 seconds)
00:51:48  * andrew9184quit (Quit: andrew9184)
00:53:35  * Industrialjoined
00:54:42  * AdolphusGustavusjoined
00:57:15  * EricBladejoined
00:58:32  * Industrialquit (Ping timeout: 260 seconds)
00:58:48  * planiganjoined
01:00:02  * ahrsquit (Remote host closed the connection)
01:00:28  * ahrsjoined
01:01:09  * planiganquit (Client Quit)
01:02:16  * mhuntjoined
01:02:19  * frankdreyquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:02:26  * orbyt_joined
01:02:52  * m31271njoined
01:04:41  * zumba_addictjoined
01:08:08  * tvwquit (Ping timeout: 240 seconds)
01:08:11  * rdg_quit (Quit: Leaving)
01:10:23  * zumba_addictquit (Read error: Connection reset by peer)
01:13:13  * KermitoniTquit (Quit: This computer has gone to sleep)
01:14:52  * ividyonquit (Quit: Leaving)
01:15:21  <mscdex>oh
01:15:30  * cadsquit (Remote host closed the connection)
01:15:52  * nya_quit (Remote host closed the connection)
01:16:06  * cadsjoined
01:16:28  * charlenopiresquit (Quit: Leaving.)
01:17:22  * charlenopiresjoined
01:17:24  * charlenopiresquit (Max SendQ exceeded)
01:18:05  * charlenopiresjoined
01:18:07  * charlenopiresquit (Max SendQ exceeded)
01:19:06  * gambl0rejoined
01:19:07  * charlenopiresjoined
01:19:09  * charlenopiresquit (Max SendQ exceeded)
01:19:38  * duderono_quit (Quit: Textual IRC Client: www.textualapp.com)
01:19:49  * charlenopiresjoined
01:19:51  * charlenopiresquit (Max SendQ exceeded)
01:20:00  * ed209quit (Remote host closed the connection)
01:20:06  * ed209joined
01:20:34  * charlenopiresjoined
01:20:36  * charlenopiresquit (Max SendQ exceeded)
01:20:43  * mezodquit (Remote host closed the connection)
01:22:17  * cadsquit (Remote host closed the connection)
01:22:41  * KermitoniTjoined
01:23:16  * SirWillquit (Ping timeout: 260 seconds)
01:24:23  * ohcibiquit (Ping timeout: 255 seconds)
01:24:56  * ChrisMorganjoined
01:26:37  <ChrisMorgan>I have some modules that are taking quite a bit of time to load, and I’d like to profile it all just to see how long it takes in loading each thing. Is there some convenient way to do that, even something as basic as writing the current time and module name on every require() call?
01:26:55  * EricBladequit (Quit: Leaving.)
01:28:07  <GreenJello>ChrisMorgan, var start = Date.now(); require('./module'); console.log(Date.now() - start)
01:28:15  <rangergord>ChrisMorgan: well, require is Module.prototype.require
01:28:15  <GreenJello>not sure if node supports the console.time api
01:28:26  * EricBladejoined
01:28:47  <rangergord>so just replace that with your own function that logs the time, calls the original one, then logs again
01:28:59  * lmatteisquit (Quit: Connection closed for inactivity)
01:29:03  <ChrisMorgan>GreenJello: I want to do it for all the modules. Individual ones is easy, but I want to figure out why e.g. require('stylelint') takes over a second!
01:29:10  <ChrisMorgan>rangergord: I’ll try that, thanks.
01:29:52  <GreenJello>ChrisMorgan, if rangergord's solution doesn't work, you could write a babel plugin or do some string manipulation in a require extension
01:30:54  * mochiyodaquit (Quit: Konversation terminated!)
01:31:14  <GreenJello>actually, babel doesn't like to touch things in node_modules, so you might have to write a custom require extension
01:32:20  <GreenJello>ChrisMorgan, seems like a fun task; I'll give implementing it a try
01:33:20  * ChrisMorganalready filed https://github.com/stylelint/stylelint/issues/2454 over require('stylelint') taking over a second with nothing else installed
01:33:31  <ljharb>ChrisMorgan: couldn't you just time a normal require of everything in package.json, one at a time?
01:33:37  <ljharb>you shouldn't need to instrument require
01:33:53  <ljharb>you're only looking for the outliers
01:34:07  <ChrisMorgan>ljharb: I’d like to delve inside them to figure out why they’re slow.
01:34:12  * Kitujoined
01:34:13  * Kituquit (Changing host)
01:34:13  * Kitujoined
01:34:21  <ljharb>you can also just override the require.extensions function for ".js" files
01:34:42  * mochiyoda_joined
01:34:44  * ChrisMorganisn’t familiar with the guts of Node’s require function
01:34:52  <ljharb>which is how you'd do it instead of mucking with require itself, which is actually a new function in every modle
01:35:01  <ljharb>n> require.extensions
01:35:03  <babelboot>ljharb: (okay) { '.js': [Function], '.json': [Function], '.node': [Function] }
01:36:00  <ljharb>n> var orig = require.extensions['.js']; require.extensions['.js'] = function (path) { console.log(path, 'start', Date.now()); var exp = orig(path); console.log(path, 'end', Date.now()); return exp; } @ ChrisMorgan
01:36:03  <babelboot>ChrisMorgan: (okay) [Function]
01:36:06  <ljharb>there, that should give you something that works
01:36:22  <ljharb>you'll have to analyze the output yourself ofc, but that's a different problem
01:36:37  <ChrisMorgan>Thanks.
01:36:47  <ljharb>also because of the require cache, you shouldn't get any path pair logged more than once, i think
01:38:25  * guest3295quit (Ping timeout: 246 seconds)
01:40:31  * neoncontrailsquit (Remote host closed the connection)
01:41:24  * s2013quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:41:36  * mochiyoda_quit (Quit: Konversation terminated!)
01:42:41  * mochiyoda_joined
01:43:09  * w0ngquit (Quit: leaving)
01:43:32  * w0ngjoined
01:43:43  <GreenJello>ChrisMorgan, https://gist.github.com/brigand/f5327551eefcb81d8f77756cb5069ae0
01:43:59  <GreenJello>surprisingly, it doesn't break any modules here :-)
01:44:09  <GreenJello>good thing people rarely use ) in file names
01:46:12  <ljharb>GreenJello: wait, why aren't you just preserving the original require function and using that?
01:46:18  <ljharb>wouldn't that be a more accurate timer?
01:46:34  <GreenJello>ljharb, it does preserve the original require
01:46:39  * nicknameircjoined
01:46:45  * nicknameircquit (Client Quit)
01:46:46  <GreenJello>it wraps it in a function
01:46:46  * neoncontrailsjoined
01:46:59  <ljharb>i don't see where
01:47:00  <GreenJello>m is the require('./x')
01:47:21  <ljharb>oh right, you're mocking out `require` itself
01:47:31  * jsjsjsnodenodenojoined
01:47:35  <GreenJello>not mocking it, wrapping it
01:47:39  <ljharb>right
01:47:45  <ljharb>i'm saying instead of doing that at all, using eval and adding parse time, it should just do "whatever the original JS thing did" and time before and after
01:47:51  <ljharb>it seems like that'd be more accurate and way simpler
01:48:06  <GreenJello>I'm not following
01:48:41  * a_thakurjoined
01:48:50  * not-an-aardvarkquit (Quit: Connection closed for inactivity)
01:49:27  * superlouquit (Ping timeout: 240 seconds)
01:50:06  * ASGuerreroquit
01:51:01  <ljharb>GreenJello: your implementation has "readFileSync", and writes custom javascript into it
01:51:26  <ljharb>which may be what the real `require.extensions['.js']` does, sure, but that will vary by node version, and will probably be more optimized, leading to more correct times
01:51:41  <ljharb>so my implementation just wraps, not require, but `require.extensions['.js']`
01:51:43  <GreenJello>it's about relative performance
01:52:02  <GreenJello>it doesn't matter if my function takes a second to run
01:52:07  <GreenJello>for each file
01:52:33  <ljharb>right i get that
01:52:36  * rchavikjoined
01:52:44  <jsjsjsnodenodeno>Hi
01:52:56  <ljharb>but by editing `str2` before compiling, you're doing something *different* then what uninstrumented require normally does
01:53:08  * KnownSyntaxquit (Ping timeout: 246 seconds)
01:53:08  * a_thakurquit (Ping timeout: 240 seconds)
01:53:12  <GreenJello>anyway, ChrisMorgan, updated with absolute paths https://gist.github.com/brigand/f5327551eefcb81d8f77756cb5069ae0
01:53:15  <ljharb>altering the length of a file, for example, can make v8 optimize it differently
01:53:23  <ljharb>even by adding a comment
01:53:28  * Cabanossiquit (Ping timeout: 245 seconds)
01:53:38  <ljharb>or adding 5 characters like "timed"
01:54:15  * frankdreyjoined
01:54:31  * AlHafoudhquit (Ping timeout: 246 seconds)
01:55:00  <jsjsjsnodenodeno>I need to convert audio and video files to audio/webm or mp3, what are my options?I tried ffmpeg.js but it's really slow, and i can't install ffmpeg since I don't have root access. thanks
01:55:04  <ljharb>no idea if it'd be a real problem in practice or not, just saying it's theoretically tampering with the results
01:55:12  * Cabanossijoined
01:55:16  <GreenJello>ljharb, fair points
01:55:28  * phutchinsquit (Ping timeout: 260 seconds)
01:55:59  <GreenJello>now... why doesn't mine show 'stylelint/lib/index.js' as taking the longest? :o
01:56:04  * KnownSyntaxjoined
01:56:05  * KnownSyntaxquit (Changing host)
01:56:05  * KnownSyntaxjoined
01:56:38  * phpnodejoined
01:56:50  <GreenJello>oh, because that's require()d in a.js which isn't transformed
01:57:05  * MrAbaddonquit (Ping timeout: 240 seconds)
01:58:13  * quakephilquit (Ping timeout: 268 seconds)
01:58:18  * isomorphismesjoined
01:58:46  <GreenJello>okay, wow, it's taking 1.6s after my changes
01:58:54  <isomorphismes>not a node user and I'm having trouble requiring the library I need. I have installed a lot of stuff with npm i -g --save.
01:59:31  <GreenJello>isomorphismes, don't use -g
01:59:31  <isomorphismes>looking to just get the code in https://tumblr.github.io/tumblr.js/index.html to run. say I cd into the appropriate directory; how do I get npm to install all the dependencies I need for tumblr.js?
01:59:45  <GreenJello>isomorphismes, try just running `npm install`
01:59:52  <GreenJello>that works in decent projects
01:59:55  <isomorphismes>GreenJello: ok, my error is ENOENT
02:00:13  <GreenJello>give the full error
02:00:19  <GreenJello>in a paste service
02:00:44  <ljharb>GreenJello: now, what would be cool (make this please) is a binary i could run like `timedNode --nodeArg --otherNodeArg foo.js` that would instrument `require`, run the script as if it was node, and then print out a nice report :-)
02:00:47  * AlHafoudhjoined
02:00:50  * s2013joined
02:01:04  <ljharb>then i could use it in CI to say "this module must never take more than N seconds to require" or something :-p
02:01:26  <GreenJello>ljharb, interesting idea
02:01:37  <isomorphismes>http://ix.io/ppg/js
02:02:18  <GreenJello>isomorphismes, output of `npm -v`?
02:02:29  <GreenJello>oh nevermind
02:02:32  <isomorphismes>GreenJello: 3.7.3
02:03:16  * phutchinsjoined
02:03:33  * e14quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:03:38  * platonicquit (Ping timeout: 246 seconds)
02:04:01  <GreenJello>that should be fine
02:04:09  <GreenJello>isomorphismes, try deleting node_modules and install it again
02:04:46  <GreenJello>isomorphismes, and don't run npm install in your home directory
02:04:47  <GreenJello>run it in your project directory
02:05:48  * undertugaquit (Quit: Connection closed for inactivity)
02:06:33  * nya_joined
02:06:59  * noethicsquit (Remote host closed the connection)
02:07:23  * noethicsjoined
02:07:48  * ohmyfromagejoined
02:08:59  * joyeejoined
02:10:01  * neoncontrailsquit (Remote host closed the connection)
02:10:35  * nya_quit (Ping timeout: 240 seconds)
02:11:01  * milardov_quit (Remote host closed the connection)
02:11:37  * milardovichjoined
02:11:52  * nya_joined
02:12:09  * MrAbaddonjoined
02:12:45  * pilnequit (Quit: Quitting!)
02:13:17  * frankdreyquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:13:57  * arpuquit (Ping timeout: 240 seconds)
02:13:58  * stoneburnerjoined
02:14:28  * stonebur_quit (Ping timeout: 246 seconds)
02:14:54  * br0d1nquit (Quit: Leaving)
02:15:15  * jsjsjsnodenodenoquit (Quit: Page closed)
02:15:52  * milardovichquit (Ping timeout: 246 seconds)
02:18:26  * rakesh1988joined
02:19:09  * roelmonnensjoined
02:20:10  * apparitionjoined
02:21:43  * notdanieljoined
02:22:31  * glijoined
02:22:33  * neoncontrailsjoined
02:23:08  * roelmonnensquit (Ping timeout: 240 seconds)
02:23:58  * frankdreyjoined
02:24:58  * compexquit (Ping timeout: 260 seconds)
02:27:42  * Phloxxquit (Ping timeout: 256 seconds)
02:28:24  * arpujoined
02:28:53  * ivan_the_monkeyjoined
02:29:16  * guest3295joined
02:31:01  * srl295quit (Quit: Connection closed for inactivity)
02:31:20  * Phloxxjoined
02:32:50  * Rodya_quit (Remote host closed the connection)
02:33:08  * Virtulisquit (Ping timeout: 260 seconds)
02:34:26  * sz0quit (Quit: Connection closed for inactivity)
02:35:35  * ivan_the_monkeyquit (Ping timeout: 240 seconds)
02:36:45  * Hoffmannjoined
02:37:46  * a_thakurjoined
02:38:05  * Hoffmanquit (Ping timeout: 240 seconds)
02:40:48  * HoierMquit (Ping timeout: 240 seconds)
02:40:53  * Hoffmannchanged nick to Hoffman
02:40:59  * Xtremerjoined
02:42:18  * joyee_joined
02:42:18  * joyeequit (Read error: Connection reset by peer)
02:42:49  * Emperor_Earthjoined
02:43:01  * LeBlaaancquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:43:03  * a_thakurquit (Ping timeout: 260 seconds)
02:45:06  * alphamale93joined
02:46:31  <isomorphismes>GreenJello: thanks. I have been running it in the project directory
02:47:56  <isomorphismes>GreenJello: I deleted ~/node_modules && npm install --save tumblr.js.
02:49:44  <isomorphismes>GreenJello: But now still when I run node require('tumblr.js') I get...http://ix.io/ppi
02:49:45  * s2013quit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:49:53  <alphamale93>my website works… but then after like a couple hours, I try to hit it, it brings me to nginx error page.. what’s going on!?
02:50:01  * tcarequit (Quit: Connection closed for inactivity)
02:50:21  <isomorphismes>alphamale93: what's your site name?
02:50:30  <alphamale93>im scared… you’er gonna laugh at me
02:50:50  <alphamale93>typattacks.com
02:50:52  <alphamale93>okay?!
02:50:55  <alphamale93>laugh! laugh at me!
02:50:56  <alphamale93>it’s pathetic!
02:51:20  * smccarth_joined
02:51:27  * plutoniixquit (Quit: Leaving)
02:51:53  <isomorphismes>alphamale93: are you sure you're asking in the right room? doesn't seem like a node question.
02:52:05  <alphamale93>just a node app. but yeah, you’re probably right.
02:52:11  <alphamale93>im trying to use forever
02:52:22  <alphamale93>what’s a better chat?
02:52:45  <kaylined>alphamale93: use something pm2 to manage your instances
02:53:10  <kaylined>something like*
02:53:15  <alphamale93>:O
02:53:18  <alphamale93>isn’t that what forever is?
02:53:27  <GreenJello>isomorphismes, it works for me on a more recent node version
02:53:43  <GreenJello>node 6.10.0, npm 3.10.10
02:53:45  <isomorphismes>GreenJello: thank you. i'll look up how to update node
02:53:46  * chippingquit (Ping timeout: 256 seconds)
02:53:47  * Cabanossiquit (Ping timeout: 258 seconds)
02:53:55  * EricBladequit (Quit: Leaving.)
02:53:58  <GreenJello>isomorphismes, http://nvm.sh
02:54:07  <GreenJello>lets you install any version you like without using sudo
02:54:08  * smccarthyquit (Ping timeout: 260 seconds)
02:54:49  * Cabanossijoined
02:55:59  * EricBladejoined
02:57:01  <isomorphismes>GreenJello: thanks. says `command -v nvm` .. I have no `man command` …
02:57:58  <GreenJello>isomorphismes, what distro are you using?
02:58:06  <isomorphismes>Greubuntu
02:58:09  <isomorphismes>GreenJello: ubuntu
02:58:21  <GreenJello>ljharb, any idea about isomorphismes's issue?
02:59:52  * chippingjoined
03:00:33  * plutoniixjoined
03:00:59  * rdgquit (Remote host closed the connection)
03:01:08  * nya_quit (Remote host closed the connection)
03:02:20  * nya_joined
03:04:29  * smccarth_quit (Remote host closed the connection)
03:05:14  * smccarthyjoined
03:05:35  * abijeetjoined
03:06:05  * kaylinedquit (Ping timeout: 260 seconds)
03:06:13  <isomorphismes>GreenJello: manual worked
03:06:24  <isomorphismes>GreenJello: ljharb: thanks so much, all!
03:06:33  * ahmedelgabriquit (Quit: WeeChat 1.7)
03:06:36  * andrew9184joined
03:07:18  * kaylinedjoined
03:07:20  * nya_quit (Ping timeout: 260 seconds)
03:07:34  * Cabanossiquit (Ping timeout: 264 seconds)
03:08:50  * Cabanossijoined
03:08:55  * al-damiriquit (Quit: Connection closed for inactivity)
03:08:56  <alphamale93>all right, boys
03:09:01  <alphamale93>my buggy application = I need unit tests.
03:09:04  <alphamale93>I’m gonna make the jump.
03:09:09  <alphamale93>what framework you boys all recommend?
03:09:57  <GreenJello>alphamale93, for tests? jest is good
03:10:11  <alphamale93>will I have 0 bugs after using it? :O
03:11:06  <GreenJello>"Tests prove the existence of bugs, not the absence" - dijkstra
03:11:12  <GreenJello>so, no
03:11:48  * inflamesjoined
03:12:59  <alphamale93>what does dijkstra know.. lol
03:13:04  <GreenJello>also you're unlikely to test anything
03:13:08  <GreenJello>everything*
03:13:08  * snowkidindjoined
03:13:13  <alphamale93>GreenJello: wanna watch me?
03:13:19  <GreenJello>nope
03:13:21  <GreenJello>working
03:13:26  <alphamale93>GreenJello: :O
03:15:10  * s2013joined
03:15:40  * e14joined
03:16:07  <hendry>I have a Promise.all that's running stuff in parallel and it's exhausting my machines memory and causing a kill... so now I am wondering if there is something easy I can do to make the Promise.All run sequentially
03:16:32  * ohcibijoined
03:16:52  <deltab>hendry: that's not the Promise.all; it's the thing you're doing before it
03:17:09  * e14quit (Client Quit)
03:18:06  <deltab>(Promise.all doesn't run anything; it just collects results from a number of promises)
03:19:23  * baweaverchanged nick to baweaver_away
03:19:54  * LeBlaaancjoined
03:20:14  <deltab>you can use p2 = p.then(f) to wait until p resolves before calling f
03:21:12  <hendry>ok, the Promise that it runs inside the Promise.all( body is the issue surely? not before it.
03:21:48  <deltab>a promise doesn't run; it's a wrapper around a result
03:23:37  <alphamale93>should my backend and frontend having separate testing frameworks in a node.js app?
03:23:59  <deltab>hendry: look at what returned the promise
03:25:31  * abijeetquit (Remote host closed the connection)
03:25:46  * EricBladequit (Quit: Leaving.)
03:27:27  * sqramjoined
03:28:25  <hendry>deltab: the map? https://gist.github.com/kaihendry/36651f7cc022c6717a43aff7e2750d8c
03:28:25  * andrew9184_joined
03:28:26  * jazzhandsjoined
03:28:27  * andrew9184quit (Ping timeout: 240 seconds)
03:28:28  * andrew9184_changed nick to andrew9184
03:28:44  <hendry>can I make the map run sequentially? it seems to run everything in parallel atm
03:29:11  * EricBladejoined
03:29:14  <jazzhands>do you mean Array.prototype.map?
03:30:42  * the_antjoined
03:31:01  <myndzi>hendry: if that's bluebird, you can do .map(fn, { concurrency: 1 })
03:31:07  * planiganjoined
03:31:11  <hendry>jazzhands: yes, I think so
03:31:25  <hendry>myndzi: just using vanilla nodejs 7.x
03:31:55  <isomorphismes>GreenJello: ljharb all working now. many thanks
03:31:59  <myndzi>ah, well, Array.map is synchronous, but it won't wait for a promise to complete
03:32:06  <isomorphismes>best irc session eva
03:32:12  * safejoined
03:32:17  <deltab>hendry: you can use reduce instead
03:32:19  <myndzi>you'll either need to augment it or use some existing libraries
03:33:29  <deltab>videos.outputs.reduce((p, video) => downloadImage(video).then(imagePath => { ... }), Promise.resolve())
03:33:29  * andrew9184quit (Ping timeout: 260 seconds)
03:33:44  <myndzi>you can use something like https://github.com/cscott/prfun if you don't want the full bluebird library or whatever
03:35:07  * dirtyroshiquit (Quit: Leaving)
03:35:07  <hendry>deltab: what is "p" in 'reduce((p, video)' ?
03:35:18  <myndzi>the accumulator (previous promise)
03:35:46  <myndzi>that reduce is a way of chaining the thens together dynamically, but you have to do a little more work to also accumulate the actual results than shown above
03:35:51  <hendry>do i have to initialise that p ?
03:35:58  <myndzi>it's initialized to Promise.resolve()
03:36:58  <myndzi>also that needs a p.then() in it
03:37:29  * lampd1quit (Quit: Connection closed for inactivity)
03:38:15  <deltab>oops, yes
03:39:22  <hendry>so what does it look like with p.then ?
03:39:33  * milardovichjoined
03:39:49  <myndzi>something like this: https://gist.github.com/myndzi/b00ee9cc4fe83cc917a279b788dec9cf
03:41:19  <myndzi>will basically build up the equivalent of downloadImage(arr[0]).then(res => downloadImage(arr[1]).then(res2 => res.concat(res2))) infinitely
03:42:05  * lampd1joined
03:42:06  <myndzi>i definitely recommend checking out bluebird though, it has a lot of useful helpers for this sort of thing
03:42:12  * deltabnods
03:42:15  <myndzi>prfun doesn't seem to support a concurrency limit on map fwiw
03:42:16  <hendry>starting to think if i need Promise.All ? https://gist.github.com/kaihendry/36651f7cc022c6717a43aff7e2750d8c#file-gistfile1-txt-L1
03:42:26  * kingarmadilloquit (Ping timeout: 268 seconds)
03:42:51  * sfajoined
03:43:01  <myndzi>all won't force it to behave sequentially
03:43:11  * BobGneujoined
03:44:23  * milardovichquit (Ping timeout: 258 seconds)
03:44:46  <deltab>it can't: it doesn't take any functions
03:45:03  * xalljoined
03:47:05  * jxdonesquit (Ping timeout: 240 seconds)
03:48:22  <hendry>myndzi: do I understand correctly that the result of reduce will be 'results'? https://gist.github.com/myndzi/b00ee9cc4fe83cc917a279b788dec9cf
03:51:15  <myndzi>yes, results should be an array of the result of the promiseFn called with each item from array
03:51:26  * nya_joined
03:51:31  <myndzi>i usually use 'arr' instead of array to reduce confusion with Array, whoops
03:51:37  * devcquit (Quit: zzz...)
03:51:43  * graffixjoined
03:51:45  <myndzi>(note: untested, could be broken :P)
03:51:48  * Cabanossiquit (Ping timeout: 245 seconds)
03:51:51  <myndzi>but the idea is correct
03:53:12  * frankdreyquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:53:57  * Cabanossijoined
03:54:15  * smokeyseajoined
03:57:32  * neoncontrailsquit (Remote host closed the connection)
03:57:40  * BobGneuquit (Read error: Connection reset by peer)
03:58:00  * chiperquit (Quit: Daisy... daisy... (Computer went to sleep))
03:59:11  * EricBladequit (Quit: Leaving.)
04:00:19  * blessYahujoined
04:00:51  * EricBladejoined
04:00:51  * prionsquit (Remote host closed the connection)
04:06:02  * orbyt_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:06:51  * frankdreyjoined
04:07:20  * Blktquit (Read error: Connection reset by peer)
04:07:21  * roelmonnensjoined
04:07:31  * s2013quit (Quit: My Mac has gone to sleep. ZZZzzz…)
04:07:34  * baweaver_awaychanged nick to baweaver
04:08:35  * graffixquit (Ping timeout: 240 seconds)
04:08:37  * safequit (Read error: Connection reset by peer)
04:08:43  * Blktjoined
04:09:32  * mvenjoined
04:10:43  * omnihilquit (Ping timeout: 240 seconds)
04:11:27  * nya__joined
04:11:28  * roelmonnensquit (Ping timeout: 240 seconds)
04:11:56  * omnihiljoined
04:13:47  * IncompleteNinnyquit (Read error: Connection reset by peer)
04:14:10  * nya_quit (Ping timeout: 264 seconds)
04:15:53  * bocanerijoined
04:15:54  * bocaneriquit (Max SendQ exceeded)
04:17:07  * EyePulpjoined
04:17:47  * Kituquit (Remote host closed the connection)
04:18:37  * BobGneujoined
04:18:58  * bocanerijoined
04:21:30  * Virtulisjoined
04:21:58  * EyePulpquit (Ping timeout: 264 seconds)
04:23:10  * nya_joined
04:23:24  * snowkidindquit (Quit: astalaPIZZA Baby!)
04:23:37  * safejoined
04:24:54  * Xtremerquit (Quit: My Mac has gone to sleep. ZZZzzz…)
04:26:46  * frankdreyquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:27:09  * nya__quit (Ping timeout: 260 seconds)
04:28:06  * bocaneriquit (Quit: Leaving)
04:28:32  * bocanerijoined
04:28:32  * bocaneriquit (Max SendQ exceeded)
04:29:18  * rohanrhuquit (Ping timeout: 268 seconds)
04:29:33  * mskrypetsjoined
04:30:20  * graffixjoined
04:30:51  * EricBladequit (Quit: Leaving.)
04:30:59  * a_thakurjoined
04:32:07  * ivan_the_monkeyjoined
04:32:09  * toijoined
04:32:14  * EricBladejoined
04:34:09  * a_thakurquit (Read error: Connection reset by peer)
04:34:15  * a_thakurjoined
04:34:18  * zxcjoined
04:36:01  * milardovichjoined
04:36:23  * horseyjoined
04:36:24  * drewolsonquit (Quit: Ping timeout (120 seconds))
04:36:54  * ohmyfromagequit (Ping timeout: 258 seconds)
04:36:58  * dustinmquit (Quit: Leaving)
04:37:17  * akivaquit (Ping timeout: 258 seconds)
04:38:26  * Cabanossiquit (Ping timeout: 258 seconds)
04:38:47  * dustinmjoined
04:38:52  * Cabanossijoined
04:39:13  * noteboxjoined
04:39:35  * graffixquit (Ping timeout: 240 seconds)
04:39:44  * noteboxquit (Client Quit)
04:40:08  * milardovichquit (Ping timeout: 240 seconds)
04:41:09  * ivan_the_monkeyquit (Ping timeout: 260 seconds)
04:41:40  * u0m3__joined
04:41:45  * mskrypetsquit (Quit: Leaving.)
04:43:08  * zxcquit (Ping timeout: 240 seconds)
04:43:12  * jaaqoquit (Ping timeout: 246 seconds)
04:43:19  * jaaqo_joined
04:43:41  * zxcjoined
04:44:05  * bocanerijoined
04:44:38  * u0m3_quit (Ping timeout: 246 seconds)
04:44:42  * graffixjoined
04:44:59  * neoncontrailsjoined
04:47:46  * omnipotjoined
04:49:05  * graffixquit (Ping timeout: 240 seconds)
04:58:01  <hendry>any ideas why finish is being called immediately in my example here? End goal is promisfy a download here https://static.spuul.com/devops/2017-03-30/testdownload.js
04:58:09  * akivajoined
04:59:27  * graffixjoined
05:01:01  * troykellyquit (Quit: Farewell. So long.)
05:02:14  * SteffanWjoined
05:02:15  * EricBladequit (Quit: Leaving.)
05:02:24  * chippingquit (Ping timeout: 256 seconds)
05:02:35  * horseyquit (Ping timeout: 240 seconds)
05:03:32  * blessYahuquit (Ping timeout: 246 seconds)
05:03:35  * graffixquit (Ping timeout: 240 seconds)
05:03:36  * mhuntquit (Quit: mhunt)
05:03:58  <ChrisMorgan>If I cared enough about the npm ecosystem I think I’d be starting a crusade to get people to roll up their modules before uploading them to npm. Because it’s looking like there is per-file overhead approaching 1ms, and plenty of packages use dozens or hundreds of files when they simply don’t need to.
05:04:14  * safequit (Quit: Leaving)
05:05:10  * cesconixjoined
05:05:22  * Endarkedjoined
05:05:40  * bgiannanquit (Quit: WeeChat 1.7)
05:06:02  * chippingjoined
05:07:24  * SteffanWquit (Read error: Connection reset by peer)
05:08:23  * SirWilljoined
05:08:36  * EricBladejoined
05:09:45  * bgiannanjoined
05:09:59  * bgiannanquit (Client Quit)
05:11:49  * schneid_3306joined
05:12:33  * graffixjoined
05:13:26  * LeBlaaancquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:14:08  * hfp_workquit (Ping timeout: 240 seconds)
05:14:33  * bgiannanjoined
05:15:33  * yeahjohnnnquit (Ping timeout: 268 seconds)
05:15:57  * jerrcsquit (Ping timeout: 260 seconds)
05:15:57  * schneid3306quit (Ping timeout: 260 seconds)
05:15:58  * chenquit (Ping timeout: 260 seconds)
05:15:58  * archhereticquit (Ping timeout: 260 seconds)
05:16:05  * jerrcsjoined
05:16:09  * niemaljoined
05:16:32  * hfp_workjoined
05:16:34  * chenjoined
05:17:00  * archhereticjoined
05:17:09  * rzyzquit (Ping timeout: 258 seconds)
05:18:56  * dk0rquit (Ping timeout: 260 seconds)
05:21:56  * yeahjohnnnjoined
05:24:11  * inflamesquit (Ping timeout: 268 seconds)
05:25:05  * varunestjoined
05:25:30  * inflamesjoined
05:27:16  * smccarthyquit
05:27:39  * varunest_joined
05:27:46  * apparitionquit (Quit: Bye)
05:28:23  * cesconixquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:28:25  * YoYquit (Quit: Leaving...)
05:29:38  * YoYjoined
05:29:58  * ashnurquit (Ping timeout: 240 seconds)
05:30:05  * varunestquit (Ping timeout: 240 seconds)
05:30:20  * Xitijoined
05:31:18  * ezioquit (Ping timeout: 256 seconds)
05:31:35  * Guest98176quit (Ping timeout: 268 seconds)
05:31:43  * Ephemeralquit (Quit: ZNC - http://znc.in)
05:31:45  * not-an-aardvarkjoined
05:32:10  * `DanZimmquit (Ping timeout: 264 seconds)
05:32:35  * ra4kingquit (Ping timeout: 246 seconds)
05:32:35  * shamanimequit (Ping timeout: 246 seconds)
05:32:38  <ljharb>isomorphismes: if you have any further nvm issues, please ask in #nvm
05:32:49  * gr4yscal2quit (Ping timeout: 268 seconds)
05:32:57  <ljharb>ChrisMorgan: that only matters at bootup time tho
05:33:00  * webnannersquit (Ping timeout: 256 seconds)
05:33:01  * AlgorithmWizardquit (Ping timeout: 256 seconds)
05:33:01  * xratedquit (Ping timeout: 256 seconds)
05:33:02  * gr4yscal1joined
05:33:04  * C0deMaver1ckjoined
05:33:14  <ljharb>ChrisMorgan: since dynamic requires, and non top level requires, are a bad practice, all requires happen at boot up
05:33:19  <ljharb>and then everything's cached
05:33:26  * pelegrenoquit (Ping timeout: 268 seconds)
05:33:28  * C0deMaver1ckchanged nick to Guest84056
05:33:37  * DanZimmjoined
05:33:40  * ashnurjoined
05:33:40  * ashnurquit (Changing host)
05:33:40  * ashnurjoined
05:33:56  * eziojoined
05:34:18  * shamanimejoined
05:34:31  <ChrisMorgan>ljharb: only!? That’s a big deal. Many tools are started regularly, rather than being kept alive. Many people have build scripts made of makefiles using command line interfaces to these things, and so forth, processing each file individually.
05:34:32  * webnannersjoined
05:34:55  * inflamesquit (Read error: Connection reset by peer)
05:35:04  * inflamesjoined
05:35:05  * AlgorithmWizardjoined
05:35:23  * pelegreno_joined
05:35:28  * jud^quit (Read error: Connection reset by peer)
05:35:40  <ChrisMorgan>I don’t want to wait a completely unnecessary second or two for stylelint to wake up when it could do exactly the same thing in half a second shorter.
05:35:45  * ra4kingjoined
05:35:56  * xratedjoined
05:36:12  * jud^joined
05:37:44  <ljharb>that seems like a really negligible problem. however, for a command line tool *only*, i think that your rollup suggestion might make sense
05:38:34  * EricBladequit (Quit: Leaving.)
05:38:36  * kingarmadillojoined
05:38:37  <ChrisMorgan>This is low-hanging performance-optimisation fruit. Everything should be doing it.
05:39:16  <ljharb>i don't agree
05:39:26  <ljharb>rolling things up would destroy valuable entry points
05:39:48  <ljharb>and deep-requiring things is a HUGE runtime optimization for browser code that's far more important than the bootup cost of requiring it.
05:40:04  <ljharb>actually it's an optimization for server code too
05:40:20  <ljharb>because it means you don't have to require the kitchen sink, but instead can grab just the file you need. like `require('lodash/omit')` etc
05:41:42  <ChrisMorgan>Oh, I’m not saying you should roll that stuff up. Precision is good like that. But for modules where there is one entry point only (most of them, I imagine) rolling up is sensible.
05:42:39  <ChrisMorgan>(Sorry, I had entry points in mind but didn’t make it clear when I used the word “everything”.)
05:42:43  <ljharb>there's a lot of those where i've deep-required an unintentional entry point, for geat success
05:42:50  <ljharb>*great
05:42:55  <ljharb>every file is an entry point, technically
05:42:57  * sfaquit (Ping timeout: 240 seconds)
05:43:14  * boneskulljoined
05:43:30  <ljharb>if everything is rolled up, you end up always requiring 100% of the code in the module
05:43:40  * kingarmadilloquit (Ping timeout: 260 seconds)
05:44:21  * brent__joined
05:44:41  * frankdreyjoined
05:45:52  <ChrisMorgan>ljharb: I confess I’m not totally familiar with how it works. If your node_modules/foo/package.json has {"main": "lib/foo.js"} then you can get foo.js with require("foo"), but if there’s also a file next to foo.js called bar.js, can you import it directly? `require("foo/lib/bar")` or something like that?
05:46:17  <charmander>yes, exactly like that
05:46:34  * EricBladejoined
05:46:49  <GreenJello>ChrisMorgan, you should only do that if the library documents it
05:46:58  <ljharb>ChrisMorgan: you can do that with every file in the filesystem
05:47:10  <ljharb>and if it's reachable, it's part of the API, documented or no.
05:47:12  <GreenJello>ChrisMorgan, otherwise your code can randomly break if you don't lock/shrinkwrap
05:47:32  <ljharb>if that happens tho, it's a bug. renaming or deleting files is a semver-major change
05:47:39  <charmander>no, it’s not
05:47:44  <charmander>don’t use undocumented apis
05:47:45  <ljharb>absolutely it is.
05:47:47  <ChrisMorgan>GreenJello: and there might be side-effects that need to be imported first which weren’t done with imports in each individual file.
05:47:53  <ljharb>documentation is irrelevant to "what your API is"
05:48:00  <charmander>it’s pretty relevant
05:48:06  <ljharb>if it's reachable, it's part of your API
05:48:13  <ljharb>that includes both JS and filesystem things
05:48:16  * StoBrendojoined
05:48:20  <ljharb>(which is actually an argument for the rollup approach, i realize)
05:48:21  * toiquit (Read error: Connection reset by peer)
05:48:25  <charmander>what’s an example of a semver-patch change?
05:48:25  <ChrisMorgan>Indeed.
05:48:35  <ChrisMorgan>charmander: bug fix with no API change.
05:48:38  <ljharb>^
05:48:40  <charmander>concrete example?
05:48:44  * lpinjoined
05:48:52  <ChrisMorgan>function addOne(n) { return n + 2 }
05:48:53  <ljharb>charmander: used to throw, no longer does.
05:48:56  <ChrisMorgan>Whoops, s/2/1/
05:49:01  * brent__quit (Ping timeout: 246 seconds)
05:49:03  <ChrisMorgan>semver-patch.
05:49:03  * sfajoined
05:49:05  * toijoined
05:49:09  <charmander>ChrisMorgan: I was relying on addOne adding two
05:49:13  <charmander>it was part of your api apparently
05:49:19  <GreenJello>ljharb, that's part of the api, no?
05:49:22  <ljharb>charmander: i see the slippery slope argument you're trying to make
05:49:23  <ljharb>no, it's not.
05:49:33  <ljharb>and i realize it's subjective and fuzzy
05:49:42  <ljharb>but case by case, some things are clearly patches and some are clearly breaking
05:49:56  * horseyjoined
05:50:07  <ljharb>and sometimes, you have to make patches semver-major just to be safe. and sometimes you make the patch and just intentionally break people (but then you're a jerk)
05:50:31  <GreenJello>JS is too dynamic for this purity
05:50:44  <charmander>and sometimes, you should just use the API as documented, and also never specify anything other than an exact version
05:50:56  <ljharb>one might have to bend because of that dynamism, but that doesn't mean the default shouldn't be "this purity"
05:51:05  <ljharb>charmander: you should always specify a ^ range.
05:51:17  <GreenJello>but also lock/shrinkwrap
05:51:17  <ChrisMorgan>charmander: 1 → 2 would be a semver-breaking change because it was obviously documented as adding one. 2 → 1 isn’t a semver-breaking change because it was a logic error, a bug that you’re fixing.
05:51:22  <ljharb>and optionally shrinkwrap, if it's a top-level app. but pinning a dep never guarantees you anything.
05:51:26  * notdanielquit (Quit: Leaving)
05:51:34  <charmander>no, you should never specify a ^ range
05:51:40  <charmander>(not actually never)
05:51:41  * ChrisMorgansmugly uses yarn so the lockfile stuff is done properly automatically
05:51:42  <GreenJello>and you can just delete the lock file and generate a new one to update to compatible releases
05:51:51  <ljharb>charmander: it is unarguably a best practice to always do so.
05:51:57  <ljharb>charmander: things that pin deps are bad for the ecosystem.
05:52:00  <charmander>keep your dependency tree small and up to date
05:52:12  <ljharb>charmander: pinning deps only does harm. if you want locking, use shrinkwrap or similar.
05:52:27  <ljharb>but the ^ is a critical indicator that the dep follows semver.
05:52:34  * Cabanossiquit (Ping timeout: 264 seconds)
05:52:48  <ljharb>and it allows, when updating, important bugfixes and security patches to cascade in
05:52:50  * smokeyseaquit (Ping timeout: 256 seconds)
05:52:54  <ljharb>(which is the ecosystem part)
05:53:07  <charmander>https://github.com/brianc/node-postgres/pull/1154#issuecomment-265636780
05:53:27  * rangergordquit (Ping timeout: 240 seconds)
05:53:30  * w0ngquit (Quit: leaving)
05:53:59  * Cabanossijoined
05:54:01  <charmander>If you use a caret version, security patches cascade in… without your version number changing, leaving those who installed your package before those fixes were available in the dark
05:54:01  <GreenJello>a lock file would solve that
05:54:07  * w0ngjoined
05:54:13  <charmander>GreenJello: It does not solve the problem for new installers
05:54:24  <GreenJello>true
05:54:58  <charmander>In an ideal world, everyone would specify exact versions and instantly update their packages on any change. It isn’t an ideal world, but you can get close to this by having few dependencies.
05:55:02  <charmander>which is nice for other reasons.
05:55:12  * roelmonnensjoined
05:55:24  * jazzhands1joined
05:55:25  <ljharb>charmander: that's what their tests are supposed to cover.
05:55:35  <ljharb>also i highly disagree with that. more dependencies is better.
05:55:35  <charmander>ljharb: Whose tests?
05:55:43  <charmander>What’s what?
05:55:53  <ljharb>whose tests? whoever's the package.json we're talking about
05:55:56  <ljharb>the "new installers"
05:56:44  <charmander>pg depends on pg-pool ^1.4.0. pg-pool is updated to ^1.5.0 and subtly breaks new installs of pg.
05:56:48  * conmaxoquit (Remote host closed the connection)
05:56:58  <charmander>Are you saying users of a package should test their packages as part of their own tests?
05:57:02  <ljharb>charmander: sure, then pg-pool had insufficient tests
05:57:29  <ljharb>charmander: i'm saying all tests should be integration tests, and whatever behavior they depended on from pg-pool should have been exercised in their tests.
05:57:33  * ^^^^quit (Remote host closed the connection)
05:57:42  <ljharb>they shouldn't write tests *for* pg-pool obviously
05:57:54  <ljharb>but their tests for their code that *uses* pg-pool should break if pg-pool does.
05:58:05  <charmander>They’re newly installing a package. Starting a project.
05:58:08  <ljharb>ok
05:58:08  * jazzhandsquit (Ping timeout: 260 seconds)
05:58:09  * ^^^^joined
05:58:11  <ljharb>then nothing's broken
05:58:29  <charmander>and yet this happened and it was broken
05:58:32  <ljharb>and they have no behavior that can be broken, until they've written it. and if they have, they should write tests for it. which should expose any breakage.
05:58:36  <charmander>my comment also talks about trust
05:58:36  <ljharb>right, so, write better tests
05:58:46  * wsierocijoined
05:58:53  <ljharb>"trust" and "blind trust" aren't the same thing.
05:59:06  <ljharb>i trust intentions. that's not the same as trusting correctness.
05:59:08  <charmander>let’s say pg starts depending on is-array-buffer-x ^1.0.13 – something that almost happened
05:59:08  * roelmonnensquit (Ping timeout: 240 seconds)
05:59:25  <ljharb>ok
05:59:31  <ljharb>so what's wrong with that
05:59:38  <charmander>maintainer publishes 1.0.14 with a preinstall script that uploads your SSH keys. nice
06:00:09  <charmander>a caret version at any part of your dependency tree means you have to trust all maintainers of that package, forever
06:00:25  * BobGneuquit (Read error: Connection reset by peer)
06:00:27  <ljharb>yes, you should.
06:00:36  * wsierociquit (Remote host closed the connection)
06:00:36  <charmander>I don’t trust the maintainer of is-array-buffer-x
06:00:41  <ljharb>then don't use it
06:00:48  <ljharb>you should never use any version of a package if you don't trust the maintainer.
06:01:06  <ljharb>also, `npm install` runs as nobody, so your preinstall script wouldn't be able to get your ssh keys anyways
06:01:10  <ljharb>so, zero risk
06:01:14  <ljharb>what's the problem again?
06:01:38  <charmander>because it’s an extremely simple package, I wouldn’t have to trust the maintainer if I specified an exact version
06:01:40  <charmander>just npmjs.com
06:01:52  <charmander>risk greatly reduced
06:01:55  * StoBrendochanged nick to dissapointed
06:01:58  <ljharb>right but there's zero risk to start with
06:02:01  <ljharb>so there's nothing to reduce
06:02:12  <ljharb>at least, of the attack vector you mentioned
06:02:23  <ljharb>but also that's why you use a lockfile on your app
06:02:33  <ljharb>and you audit *every dependency in the entire tree that changes* whenever you update that lockfile
06:02:42  <charmander>Okay, forget the preinstall scripts: the package just grabs your keys when it’s imported
06:02:49  <charmander>presumably, because it’s a dependency, it will be imported
06:02:54  <ljharb>why would the user running `node` have access to that?
06:02:57  <ljharb>sounds like an opsec fail
06:03:02  <charmander>lockfiles, I repeat, do not solve the problem for new installers
06:03:15  <charmander>ljharb: You’ve never run gulp-cli? Props
06:03:17  <ljharb>sure. but there is no problem yet.
06:03:19  <ljharb>no, gulp is trash
06:03:27  <ljharb>and if i did, i'd run it via an npm run-scrit
06:03:30  <ljharb>*run-script
06:03:37  <charmander>cool well lots of people do actually run programs
06:03:39  <ljharb>which sets the user, and prevents all those exploits
06:03:46  <ljharb>ok well then, it seems that's the real problem
06:03:52  <charmander>yes. the real problem is the people
06:03:55  <ljharb>not actual dependencies, just command line tools installed globally and ran directly
06:04:03  <ljharb>so, don't install things globally?
06:04:17  <charmander>and don’t work on projects in your home directory, it seems
06:04:36  <charmander>you have to move them somewhere else and give the Node user permission to that location
06:04:39  <charmander>and then run everything as that user
06:05:01  <ljharb>right, that's fair in dev
06:05:01  <ljharb>ok
06:05:06  <ljharb>but again, you audit the code. in new installs too.
06:05:25  <ljharb>pinning dep versions doesn't save you on new installs either
06:05:28  <GreenJello>you can't really audit in conventional node
06:05:42  <ljharb>because if 1.0.13 is good, and 1.0.14 is bad, someone will do `npm install foo` and get latest.
06:05:48  <charmander>Sure, and you can do that as a developer, and I do (for small numbers of dependencies – one of the aforementioned advantages is that an audit is actually feasible)
06:05:48  <ljharb>so, again, pinning deps gives you *zero value*
06:05:50  * rzyzjoined
06:05:52  <GreenJello>I have 988 packages in one project
06:05:53  * Chumjoined
06:05:54  <charmander>*application developer
06:06:04  <charmander>but if you’re a package maintainer, you can’t trust your *users* to do that
06:06:09  <ljharb>also, nodesecurity does that
06:06:10  <charmander>and perhaps you consider that an acceptable risk
06:06:12  <ljharb>so, `nsp check`, done?
06:06:26  <charmander>but I’d rather just have a few dependencies I verify and let people install my packages without worry
06:06:29  <ljharb>charmander: i'm not saying security isn't hard, and there's risks. there are.
06:06:46  <ljharb>charmander: i'm saying that pinning deps solves effectively zero of those risks.
06:06:57  <ljharb>and in practice, what you're talking about just doesn't happen
06:07:07  <GreenJello>also you're not pinning deps of deps
06:07:11  <ljharb>^
06:07:19  <charmander>GreenJello: Which is why I mentioned keeping your dependency tree small
06:07:19  <ljharb>that's why you need a lockfile, and with a lockfile, pinning is irrelevant
06:07:23  <charmander>and why I brought up the comment on pg
06:07:38  <ljharb>you can use ^ in your package.json, and use a lockfile, and you get the value you want
06:07:41  <charmander>which is about how, even if the one dependency is pinned, it has caret dependencies on packages with untrustworthy maintainers
06:07:50  <ljharb>right but that's not a problem, with a lockfile
06:08:03  <charmander>which is not applicable to new installs
06:08:07  <ljharb>and again, if you don't trust a maintainer, do not trust any package by them, or that depends on their package
06:08:11  <charmander>I’m going to stop repeating myself now and move on
06:09:06  <ljharb>the best practice is to always use ^, and always use a lockfile at the top level. i never use any package that doesn't. all my packages do. this is also the prevailing community practice, and will continue to be so.
06:09:14  <ljharb>you're welcome to your opinion, but it's not shared widely
06:10:05  * Chumquit (Ping timeout: 240 seconds)
06:10:45  <charmander>hey, if I always went with what was popular I’d end up on this extremely sad list https://www.npmjs.com/browse/depended/lodash.isnull
06:11:16  <ljharb>there's nothing wrong with using that package.
06:11:18  <charmander>shallow dependency trees make for a good time
06:11:22  <ljharb>personally i use === null, but there's nothing wrong with it.
06:11:33  <ljharb>shallow dep trees are a symptom of NIH. NIH is a cancer.
06:11:42  <charmander>ljharb: using this package instead of === null is extremely wrong
06:11:49  <charmander>although you’re welcome to your opinion
06:11:52  <ljharb>it's really not.
06:12:27  * alphamale93quit (Quit: alphamale93)
06:12:41  * alibby1quit (Read error: No route to host)
06:12:43  <ljharb>if you truly believe that, why haven't you made 36 PRs to all those packages to remove it?
06:12:56  <ljharb>that would take what, a day? maybe two if you're not that quick at it?
06:12:57  * alibby1joined
06:13:48  <ljharb>or why haven't you asked the lodash author to deprecate it?
06:13:55  <ljharb>be the change :-p
06:13:58  <charmander>ljharb: this isn’t a very productive line
06:14:35  * ch007mjoined
06:14:39  <charmander>I have more important things to ask to be deprecated, like an insecure regex-based XSS filter (I asked; it never was)
06:15:02  <charmander>use of lodash.isnull is sad but doesn’t need to be fixed
06:15:16  * frankdreyquit (Ping timeout: 246 seconds)
06:15:20  * horseyquit (Read error: Connection reset by peer)
06:15:34  <ljharb>¯\_(ツ)_/¯ then i guess it's not "really wrong"
06:15:46  <charmander>i guess not huh ljharb
06:15:46  * Chumjoined
06:16:33  * EricBladequit (Quit: Leaving.)
06:17:53  * roelmonnensjoined
06:17:53  * m31271nquit (Remote host closed the connection)
06:17:56  * ivan_the_monkeyjoined
06:18:08  * roelmonnensquit (Remote host closed the connection)
06:18:09  * cesconixjoined
06:18:13  * tarwaterjoined
06:18:37  * roelmonnensjoined
06:18:50  * m31271njoined
06:18:57  * EricBladejoined
06:19:49  * Chumquit (Ping timeout: 246 seconds)
06:22:08  * tarwaterquit (Ping timeout: 240 seconds)
06:24:08  * milardovichjoined
06:24:34  * frankdreyjoined
06:25:00  * kaylinedquit (Ping timeout: 260 seconds)
06:26:07  * dk0rjoined
06:26:09  * rendarjoined
06:27:03  * KermitoniTquit (Quit: Leaving)
06:28:32  * i5dr0idjoined
06:28:32  * i5dr0idquit (Changing host)
06:28:32  * i5dr0idjoined
06:28:48  * groomjoined
06:29:06  * milardovichquit (Ping timeout: 256 seconds)
06:29:23  * i5dr0idquit (Client Quit)
06:29:37  * hagabakaquit (Ping timeout: 246 seconds)
06:30:06  * horseyjoined
06:30:14  * techietrashquit (Ping timeout: 256 seconds)
06:30:36  * Flynnnjoined
06:30:50  * christicknerquit (Ping timeout: 255 seconds)
06:31:13  * arquebusjoined
06:31:17  * tnsiquit (Ping timeout: 260 seconds)
06:31:17  * Efreakquit (Quit: Efreak wuz here)
06:31:22  * herme5quit (Ping timeout: 256 seconds)
06:31:22  * mgolquit (Ping timeout: 256 seconds)
06:31:28  * ch007mquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
06:31:34  * zchrykngquit (Ping timeout: 264 seconds)
06:31:37  * Efreakjoined
06:31:56  * gsathyaquit (Ping timeout: 256 seconds)
06:31:56  * jfhbrookquit (Ping timeout: 256 seconds)
06:31:57  * substackquit (Ping timeout: 240 seconds)
06:31:58  * zchrykngjoined
06:32:00  * herme5joined
06:32:02  * jfhbrookjoined
06:32:16  * techietrashjoined
06:32:27  * gsathyajoined
06:32:50  * hagabakajoined
06:32:56  * substackjoined
06:33:37  * mgoljoined
06:33:42  * juuljoined
06:33:44  * EyePulpjoined
06:33:52  * christicknerjoined
06:34:16  <juul>is it possible to make a transform stream that is objectMode for its writable end but non-objectMode for its readable end?
06:35:29  * ChrisMorganquit (Ping timeout: 260 seconds)
06:37:16  * inflamesquit (Ping timeout: 258 seconds)
06:38:01  * cuppyquit (Quit: Electric overload!!!)
06:38:16  * EyePulpquit (Ping timeout: 260 seconds)
06:38:21  * seitenseijoined
06:38:27  * cesconixquit (Ping timeout: 240 seconds)
06:40:38  * dk0rquit (Read error: Connection reset by peer)
06:41:32  <myndzi>yes
06:41:51  * cesconixjoined
06:42:27  <myndzi>one of these two approaches, though you'd use 'writable' instead of 'readable': https://github.com/myndzi/binary-split-streams2/blob/master/index.js#L29-L34
06:43:10  <hendry>is there a better way of writing: if (!fs.existsSync(workFolder)) { fs.mkdirSync(workFolder) }; if (!fs.existsSync(inFolder)) { fs.mkdirSync(inFolder) }; if (!fs.existsSync(outFolder)) { fs.m
06:43:14  <hendry>kdirSync(outFolder) }·
06:43:38  * smokeyseajoined
06:44:10  * dongustonquit (Ping timeout: 264 seconds)
06:44:14  <myndzi>1) make a function that does the job, then call it with different parameters
06:44:27  * tockajoined
06:44:38  <charmander>ljharb: Er, how would npm run scripts as nobody, anyway?
06:44:40  <myndzi>2) you don't need to check existsSync, just do mkdir and catch the appropriate errors
06:44:42  <charmander>They tend to write files
06:44:55  * zero1one0quit
06:45:25  <ljharb>charmander: https://docs.npmjs.com/misc/scripts#user
06:45:38  <ljharb>charmander: it seems that might only be when it's invoked as root tho
06:45:39  * nitpequit (Quit: Leaving)
06:45:47  <charmander>https://www.npmjs.com/package/preinstall-whoami (https://registry.npmjs.com/preinstall-whoami) definitely prints my username
06:45:57  <charmander>Ah, yes, okay
06:46:03  <ljharb>yeah, i'm wrong there, looks like that only kicks in when invoked as root
06:46:05  * cesconixquit (Ping timeout: 240 seconds)
06:46:10  * tyljoined
06:46:37  <charmander>Thanks for pointing that out all the same
06:46:44  <charmander>(… npm install is safer as root?)
06:47:10  <juul>myndzi: wow thanks!
06:47:41  * roelmonn_joined
06:48:57  * EricBladequit (Quit: Leaving.)
06:49:58  * sfaquit (Quit: Lost terminal)
06:50:22  * arquebusquit (Quit: Leaving)
06:50:24  * zero1one0joined
06:50:25  * munch_joined
06:50:36  <ljharb>charmander: you can always `npm install --no-scripts` or whatever the command is
06:50:42  <ljharb>it's only a problem for binary deps, and those suck anyways
06:50:49  * Chumjoined
06:51:08  * roelmonnensquit (Ping timeout: 268 seconds)
06:51:23  * Cabanossiquit (Ping timeout: 245 seconds)
06:51:33  * contajoined
06:52:22  * guest3295quit (Ping timeout: 246 seconds)
06:54:06  * Cabanossijoined
06:54:12  <charmander>ljharb: Yep, and I actually do something about that one https://www.npmjs.com/package/sharp-binaryless
06:54:18  <hendry>is there something nodeJS that can exec a binary and produce stats like how much resources it's taking and such and such ?
06:54:40  * Dreconusquit (Remote host closed the connection)
06:54:45  * smiileyjoined
06:55:01  <ljharb>nice
06:55:28  * Dreconusjoined
06:56:18  * EricBladejoined
06:56:58  * neoncontrailsquit (Remote host closed the connection)
06:57:27  * Chumquit (Ping timeout: 240 seconds)
06:58:34  * the_antquit (Remote host closed the connection)
06:59:18  * the_antjoined
07:00:11  * Chumjoined
07:07:29  * Stapinjoined
07:07:35  * Duckehquit (Ping timeout: 260 seconds)
07:07:36  * dongustonjoined
07:07:51  * milardovichjoined
07:09:49  * Flynnnquit (Quit: Auf Wiedersehen!)
07:11:41  * the_ant1joined
07:12:12  * zwaragjoined
07:13:17  * the_antquit (Ping timeout: 260 seconds)
07:13:17  * the_ant1changed nick to the_ant
07:15:05  * led1quit (Quit: led1)
07:15:40  * nschoejoined
07:17:57  * lucasemquit (Ping timeout: 240 seconds)
07:18:04  * tarwaterjoined
07:20:07  * lucasemjoined
07:21:41  * phpnode_joined
07:21:43  * nd__joined
07:22:07  * tarwaterquit (Ping timeout: 246 seconds)
07:23:12  * Industrialjoined
07:23:35  * phpnodequit (Ping timeout: 240 seconds)
07:23:51  * Silencedjoined
07:24:12  * flaviodesousajoined
07:26:19  * EricBladequit (Quit: Leaving.)
07:26:21  * Silencedquit (Changing host)
07:26:21  * Silencedjoined
07:27:45  * EricBladejoined
07:29:01  * roelmonn_quit (Remote host closed the connection)
07:29:30  * roelmonnensjoined
07:30:25  * cesconixjoined
07:31:16  * bf_joined
07:31:49  * phpnode_quit
07:31:56  * led1joined
07:32:22  * Endarkedquit (Quit: WeeChat 1.7)
07:32:49  * Silencedquit (Quit: ZNC 1.6.2 - http://znc.in)
07:33:28  * Silencedjoined
07:33:56  * Silencedquit (Changing host)
07:33:56  * Silencedjoined
07:34:40  * rejquit (Quit: Obviously a major malfunction.)
07:34:48  * conmaxojoined
07:34:57  * rejjoined
07:34:57  * rejquit (Changing host)
07:34:57  * rejjoined
07:36:25  * bf_quit (Read error: No route to host)
07:38:14  * heraxquit (Ping timeout: 246 seconds)
07:38:36  * Cabanossiquit (Ping timeout: 258 seconds)
07:39:13  * Cabanossijoined
07:39:23  * kingarmadillojoined
07:39:33  * heraxjoined
07:40:31  * rmg_joined
07:42:47  * rmgquit (Ping timeout: 246 seconds)
07:44:08  * kingarmadilloquit (Ping timeout: 240 seconds)
07:46:09  * protodavequit (Quit: ZNC - http://znc.in)
07:46:27  * cesconixquit (Ping timeout: 240 seconds)
07:46:41  * ch007mjoined
07:46:58  * Narigojoined
07:47:15  * frankdreyquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:47:15  * drehjoined
07:47:40  * chum_joined
07:47:50  * Chumquit (Read error: Connection reset by peer)
07:48:54  * chargenjoined
07:49:27  * shmujoined
07:49:30  * cesconixjoined
07:49:54  * Silencedquit (Quit: ZNC 1.6.2 - http://znc.in)
07:50:17  * Silencedjoined
07:50:18  * Silencedquit (Changing host)
07:50:18  * Silencedjoined
07:51:58  * Or1onquit (Ping timeout: 264 seconds)
07:53:10  * gambl0requit (Ping timeout: 264 seconds)
07:53:35  * milardovichquit (Ping timeout: 240 seconds)
07:57:45  * EricBladequit (Quit: Leaving.)
07:59:48  * EricBladejoined
08:00:44  * computer2000joined
08:00:51  * blessYahujoined
08:02:50  * plexigrasjoined
08:02:58  * Xitiquit (Quit: Xiti)
08:03:22  * cotkojoined
08:04:18  * staar2joined
08:04:45  * tvwjoined
08:05:10  * blessYahuquit (Ping timeout: 246 seconds)
08:05:11  * joyee_quit (Read error: Connection reset by peer)
08:05:36  * joyeejoined
08:05:41  * computer2000quit (Remote host closed the connection)
08:06:05  * computer2000joined
08:06:18  * Relequestualjoined
08:08:07  * OnkelTemquit (Ping timeout: 258 seconds)
08:08:11  * Silencedquit (Quit: ZNC 1.6.2 - http://znc.in)
08:08:46  * Cabanossiquit (Ping timeout: 264 seconds)
08:08:50  * not-an-aardvarkquit (Quit: Connection closed for inactivity)
08:08:52  * Silencedjoined
08:09:07  * Cabanossijoined
08:09:16  * gliquit (Ping timeout: 258 seconds)
08:09:24  * Silencedquit (Client Quit)
08:11:08  * OnkelTemjoined
08:11:47  * drehquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:12:59  * MrAbaddonquit (Remote host closed the connection)
08:14:40  * wtrockijoined
08:18:45  * bergicequit (Quit: Connection closed for inactivity)
08:18:50  * joyeequit (Read error: Connection reset by peer)
08:19:22  * joyeejoined
08:21:51  * glijoined
08:22:47  <cart_man>Is there a good way to get file data into an array that I can send over Socket.io ?
08:24:18  <topaxi>cart_man: you should be able to use FileReader to get an ArrayBuffer, then you can wrap the array buffer in a typedarray, which you could send
08:24:35  * the_antquit (Ping timeout: 240 seconds)
08:24:41  <topaxi>cart_man: or directly to base64 (i think FileReader supports that too? but i'm not sure)
08:24:48  <cart_man>This is my code at the moment -> https://pastebin.com/xYsv4e4U
08:25:07  * the_antjoined
08:25:10  <cart_man>At the moment all the array elements come out as 0
08:25:18  * not-an-aardvarkjoined
08:25:19  <topaxi>ah sending the file from node, i was thinking from a browser :)
08:25:20  <cart_man>topaxi Base64 Array ?
08:25:38  <cart_man>topaxi : Yea from node to Client(Browser)
08:25:46  <topaxi>no, string, unsure how to do that, never done it that way
08:27:48  <topaxi>i think you could use 'buffer' instead of 'utf8' as encoding, which gives you an Buffer object, you might be able to convert those to the array or string representation you need
08:28:18  <topaxi>beyond this i don't have any experience :)
08:29:52  * EricBladequit (Quit: Leaving.)
08:31:41  <cart_man>topaxi : Ok but how do I get it into a buffer though?
08:32:31  * regan_joined
08:32:53  * EricBladejoined
08:33:30  * ispnjoined
08:33:39  * regan_quit (Client Quit)
08:34:34  * aniothquit (Ping timeout: 246 seconds)
08:36:14  * tylquit (Quit: Sleep)
08:37:10  * noteboxjoined
08:37:42  * tyljoined
08:38:41  * chjjjoined
08:38:58  * rohanrhujoined
08:39:19  * tylquit (Client Quit)
08:41:05  * regan_joined
08:41:17  * wtrockiquit (Quit: Bye Bye ^^)
08:41:47  * bwnquit (Ping timeout: 260 seconds)
08:42:27  * wtrockijoined
08:43:07  * Silencedjoined
08:43:39  <topaxi>cart_man: instead of readfile(filename, 'utf8', ..) use readfile(filename, 'buffer', ..)
08:44:12  <topaxi>Uint8Array.from(buffer) might even work, but i haven't tried :)
08:44:47  * regan_quit (Quit: Leaving)
08:47:29  * lampd1quit (Quit: Connection closed for inactivity)
08:48:02  * sputnik13quit (Quit: Textual IRC Client: www.textualapp.com)
08:48:34  * nahtnamquit (Quit: Connection closed for inactivity)
08:49:26  * EyePulpjoined
08:51:19  * ahmedelgabrijoined
08:53:19  * Silencedquit (Quit: ZNC 1.6.2 - http://znc.in)
08:54:08  * EyePulpquit (Ping timeout: 240 seconds)
08:57:35  * noteboxquit (Ping timeout: 240 seconds)
08:58:32  * chjjquit (Quit: WeeChat 1.7)
08:59:50  * dodobrainquit (Ping timeout: 256 seconds)
08:59:58  * scippioquit (Ping timeout: 240 seconds)
09:00:42  * chjjjoined
09:00:44  * chjjquit (Client Quit)
09:01:49  * chjjjoined
09:02:04  * bwnjoined
09:02:55  * EricBladequit (Quit: Leaving.)
09:07:08  * Majiirquit (Ping timeout: 246 seconds)
09:08:27  * EricBladejoined
09:12:39  * m31271n1joined
09:14:08  * m31271nquit (Ping timeout: 240 seconds)
09:14:09  * m31271n1changed nick to m31271n
09:15:38  * noethicsquit (Remote host closed the connection)
09:17:11  * feesjoined
09:17:46  * dodobrainjoined
09:17:49  * sputnik13joined
09:18:14  * ChrisMorganjoined
09:19:11  * sputnik13quit (Client Quit)
09:19:24  * chum_quit (Quit: Leaving)
09:19:41  * m31271nquit (Remote host closed the connection)
09:19:57  * m31271njoined
09:21:05  * Majiirjoined
09:21:42  * chalker_joined
09:22:26  * Guest52758quit (Changing host)
09:22:26  * Guest52758joined
09:24:34  * SpEcHiDequit (Remote host closed the connection)
09:24:34  * EnigmaCurry[m]quit (Remote host closed the connection)
09:24:34  * xj9[m]quit (Remote host closed the connection)
09:24:34  * rainulfquit (Remote host closed the connection)
09:24:34  * Buli[m]quit (Remote host closed the connection)
09:24:34  * bgrayburn[m]quit (Remote host closed the connection)
09:24:34  * Siilwyn[m]quit (Remote host closed the connection)
09:24:34  * unclechuquit (Remote host closed the connection)
09:24:34  * observerXquit (Remote host closed the connection)
09:24:34  * M-berdarioquit (Remote host closed the connection)
09:24:35  * xorkevin[m]quit (Remote host closed the connection)
09:24:35  * M-keyvanquit (Read error: Connection reset by peer)
09:24:35  * Vladastor[m]quit (Remote host closed the connection)
09:24:35  * Powersourcequit (Remote host closed the connection)
09:24:35  * JFA[m]quit (Write error: Connection reset by peer)
09:24:35  * mirkobenedetti[mquit (Write error: Connection reset by peer)
09:24:35  * dikiaapquit (Read error: Connection reset by peer)
09:24:35  * Niels[m]quit (Read error: Connection reset by peer)
09:24:36  * Pascallo[m]quit (Write error: Connection reset by peer)
09:24:36  * petefly[m]quit (Write error: Connection reset by peer)
09:24:36  * matlag[m]quit (Read error: Connection reset by peer)
09:24:36  * Jester2[m]quit (Remote host closed the connection)
09:24:36  * jakebriggs[m]quit (Read error: Connection reset by peer)
09:24:36  * phil-flexhk[m]quit (Read error: Connection reset by peer)
09:24:37  * rjcoupe[m]quit (Read error: Connection reset by peer)
09:24:37  * zumbrunn[m]quit (Read error: Connection reset by peer)
09:24:37  * jhb[m]quit (Read error: Connection reset by peer)
09:24:37  * edgar[m]quit (Remote host closed the connection)
09:24:37  * bigblueyes[m]quit (Write error: Connection reset by peer)
09:24:38  * M__joshua__[m]quit (Write error: Connection reset by peer)
09:24:38  * Doerne[m]quit (Read error: Connection reset by peer)
09:24:38  * hbakhtiyor[m]quit (Write error: Connection reset by peer)
09:24:38  * ganlubquit (Read error: Connection reset by peer)
09:24:38  * wires[m]quit (Read error: Connection reset by peer)
09:24:38  * gabrin[m]quit (Read error: Connection reset by peer)
09:24:38  * Ivantan[m]quit (Remote host closed the connection)
09:24:38  * krigare[m]quit (Write error: Broken pipe)
09:24:38  * M-test12345quit (Write error: Connection reset by peer)
09:24:38  * omk1234[m]quit (Write error: Connection reset by peer)
09:25:42  * Relequestualquit (Quit: Textual IRC Client: www.textualapp.com)
09:26:13  * xj9[m]joined
09:27:20  * soee_joined
09:29:48  * smiileyquit (Quit: Bye)
09:31:01  * bgrayburn[m]joined
09:31:07  * unclechujoined
09:31:07  * rainulfjoined
09:31:07  * xorkevin[m]joined
09:31:08  * edgar[m]joined
09:31:08  * petefly[m]joined
09:31:09  * ganlubjoined
09:31:10  * observerXjoined
09:31:11  * SpEcHiDejoined
09:31:11  * dikiaapjoined
09:31:11  * M-test12345joined
09:31:13  * M__joshua__[m]joined
09:31:14  * Vladastor[m]joined
09:31:14  * M-keyvanjoined
09:31:14  * matlag[m]joined
09:31:14  * M-berdariojoined
09:31:14  * jakebriggs[m]joined
09:31:14  * jhb[m]joined
09:31:15  * Jester2[m]joined
09:31:15  * Siilwyn[m]joined
09:31:15  * Pascallo[m]joined
09:31:16  * JFA[m]joined
09:31:16  * Doerne[m]joined
09:31:16  * hbakhtiyor[m]joined
09:31:17  * Powersourcejoined
09:31:17  * zumbrunn[m]joined
09:31:18  * omk1234[m]joined
09:31:18  * Buli[m]joined
09:31:18  * EnigmaCurry[m]joined
09:31:20  * gabrin[m]joined
09:31:21  * wires[m]joined
09:31:21  * krigare[m]joined
09:31:21  * Niels[m]joined
09:31:22  * mirkobenedetti[mjoined
09:31:23  * Ivantan[m]joined
09:31:25  * bigblueyes[m]joined
09:31:25  * phil-flexhk[m]joined
09:31:25  * rjcoupe[m]joined
09:33:33  * sachacrjoined
09:34:31  * raynoldquit (Quit: Connection closed for inactivity)
09:34:41  * chjjquit (Remote host closed the connection)
09:35:26  * chjjjoined
09:35:36  * gliquit (Ping timeout: 260 seconds)
09:38:29  * EricBladequit (Quit: Leaving.)
09:39:08  * EricBladejoined
09:40:12  * kingarmadillojoined
09:41:59  * ch007mquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:43:13  * SachaCR_joined
09:44:25  * tiwestquit (Ping timeout: 268 seconds)
09:44:35  * ravenzzjoined
09:44:46  <russellw>In a test project, I added big-rational as a dependency. That itself, naturally enough, depends on big-integer. When I do require('big-integer') this works, which at one level makes sense
09:45:22  * kingarmadilloquit (Ping timeout: 260 seconds)
09:45:24  * tiwestjoined
09:45:49  <russellw>But at another level, one could argue that the dependency on big-integer is an internal detail of big-rational and it's wrong to depend on this, at least in principle a future version of big-rational could switch to a different big integer package, and if I also want to work with big integers I should explicitly add some version of big-integer as a dependency in my project
09:45:53  <GreenJello>russellw, you shouldn't depend on that; there are situations where it won't work
09:45:53  <russellw>Which viewpoint is correct?
09:46:10  <russellw>GreenJello, ah, so the second viewpoint is correct and I should explicitly add big-integer as a dependency?
09:46:14  <GreenJello>yeah
09:46:18  <alextes>russellw be explicit about your dependencies.
09:46:20  <russellw>Okay thanks
09:46:34  * chalker_quit (Ping timeout: 264 seconds)
09:46:38  * SachaCR_part
09:46:40  <GreenJello>it's just a quirk of how npm had to resolve some issues, and how the node module resolution algorithm is locked down
09:46:49  <alextes>^
09:46:50  <cart_man>I am having a hard time finding a way to make the browser dump JPG data that it just received back into a virtual file to give it a image.src to display
09:47:07  * glijoined
09:47:08  <GreenJello>this didn't happen a couple years ago
09:47:22  * sachacrquit (Quit: leaving)
09:47:25  <alextes>GreenJello before the whole flattening of the tree?
09:47:32  <GreenJello>yeah
09:47:35  * nya_quit (Remote host closed the connection)
09:48:11  * Silencedjoined
09:48:15  * chalker_joined
09:48:52  * SachaCRjoined
09:49:35  * SachaCRquit (Client Quit)
09:51:44  * MrAbaddonjoined
09:52:43  * arlekinjoined
09:53:18  * \squit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:53:24  <arlekin>hi there, not much happening on #bookshelf - would it be awful if i asked knex.js related questions here ?
09:53:33  <alextes>terrible
09:53:35  * th_quit (Ping timeout: 240 seconds)
09:53:38  * hextileXjoined
09:53:41  <alextes>go head ;]
09:53:49  <alextes>most times it's easiest to just ask.
09:53:59  <alextes>but for the record we get many DB related question.
09:54:03  <alextes>*questions
09:54:23  * martisjjoined
09:55:00  * savantgardejoined
09:55:03  * \sjoined
09:55:04  <arlekin>ok, i get errot about missing 'client' property in my knexfile
09:55:12  <arlekin>with that knexfile: http://dpaste.com/373JG37
09:55:32  <arlekin>ofc using it with: http://dpaste.com/2JTKD1H
09:55:56  <arlekin>but if i do it like: http://dpaste.com/0BH8AEM
09:55:59  <arlekin>it all works
09:56:09  <arlekin>it is an issue since i'd like to set up test db
09:56:19  <arlekin>so i need to be able to differentiate
09:57:10  <arlekin>precisely i get "knex: Required configuration option 'client' is missing.
09:57:10  <arlekin>"
09:57:39  <arlekin>not sure what i did wrong
09:58:00  * Virtulisquit (Remote host closed the connection)
09:58:11  * senayarjoined
09:58:30  <arlekin>and i don't know how to debug it - for instance check what configuration object retrieved from knexfile looks like
09:59:08  <arlekin>alextes: <notify>
09:59:49  <alextes>arlekin it looks exactly like the object you're exporting.
10:00:05  <arlekin>alextes: well it should, but i get that error for some reason
10:00:41  <alextes>If you want to check what it looks like you can just log it.
10:00:57  <alextes>so you're saying if you use the config from your first paste with your code from the second it doesn't work?
10:00:58  <arlekin>alextes: well i did sprinkle some console.logs but no cigar
10:01:07  <arlekin>alextes: precisely
10:01:18  * Silveringjoined
10:01:25  * brent__joined
10:02:06  <arlekin>alextes: funnily enough i have no trouble with freshly generated default knexfile
10:03:06  <plexigras>i want to log the diff of to strinigs to the console how would i do that?
10:04:06  <plexigras>ansidiff works but its not particularly great
10:05:15  <alextes>arlekin how are you getting the error?
10:05:20  <alextes>precisely what do you run?
10:05:35  * brent__quit (Ping timeout: 240 seconds)
10:05:46  <arlekin>alextes: im getting suspicious that the whole reason is im just stupid
10:06:05  <alextes>I don't think you're stupid. But the reason might be silly. We'll find out.
10:06:14  * elvinjoined
10:06:39  <arlekin>alextes: well it seems that since i don't pass --env to my migrate and seed:run commands it takes one from NODE_ENV which i don't set up
10:06:53  <arlekin>alextes: as i said - stupid - testing that explanation right now
10:06:55  <alextes>that's what I was guessing yes
10:07:26  <alextes>sure. if you're getting that error by running the knex migration tool, that's probably it.
10:07:38  <elvin>Why does this pattern match content beyond first line? /^\s*#%RAML\s+(\d\.\d)\s*(.*?)\s*$/m
10:07:48  * chalker_quit (Ping timeout: 260 seconds)
10:08:06  * akivaquit (Ping timeout: 240 seconds)
10:08:08  <alextes>See when your node_env is not set, knex defaults to using the development config. The development config in your case is undefined. Knex tries to grab the first key, alphabetically that's 'config' and finds it's not there and returns an error.
10:08:30  <alextes>But all this rides on the assumption you're not actually executing the code in your second paste but the migration tool instead.
10:08:42  * akivajoined
10:08:51  <arlekin>alextes: i made npm script for that actually
10:08:58  <alextes>elvin because of the multiline flag? Is this a trick question? :p
10:09:10  * EricBladequit (Quit: Leaving.)
10:09:11  <arlekin>alextes: any way, when i explicitely put --env production it works just fine
10:09:33  <arlekin>alextes: skimming docs instead of carefully reading it is gonna kill me one day, and i know it...
10:10:11  <elvin>alextes: does multiline flag make .'s include newlines? and even if it did, there's a .*? so it shouldn't match anything beyond the 1st line
10:10:12  <alextes>arlekin one small correction. I don't think it falls back to the 'development' configuration actually, just to expecting a no env configuration.
10:10:25  <alextes>arlekin haha, maybe
10:10:27  * chippingquit (Ping timeout: 240 seconds)
10:10:53  * EricBladejoined
10:11:01  * gliquit (Quit: Leaving)
10:12:08  <elvin>nevermind, found it.
10:12:22  <arlekin>alextes: anyway, thank you for support
10:12:37  * chippingjoined
10:13:14  <alextes>elvin what was it?
10:13:22  <alextes>arlekin you're welcome ^.^
10:14:03  <elvin>alextes: \s matches newlines, and I had some greedy \s earlier in the pattern, so making a . non-greedy didn't make any difference.
10:14:26  <arlekin>alextes: thanks, gotta run
10:14:29  * arlekinpart ("Leaving")
10:14:36  <alextes>o/
10:14:38  * Industrialquit (Ping timeout: 268 seconds)
10:15:01  <alextes>elvin ah yea. "\s* matches any whitespace character (equal to [\r\n\t\f\v ])"
10:15:14  <alextes>I always find: https://regex101.com/r/qfPrAY/1/ very helpful
10:17:47  <alextes>plexigras have your pick! https://npms.io/search?q=diff
10:18:17  <alextes>plexigras this one looks kinda pretty https://npms.io/search?q=diff
10:18:25  <alextes>*https://github.com/taylorhakes/variable-diff
10:19:02  <alextes>hm only 8 stars :-/
10:19:54  * savantgardequit (Remote host closed the connection)
10:20:01  * ed209quit (Remote host closed the connection)
10:20:07  * ed209joined
10:20:09  * LIEROjoined
10:20:42  * cootjoined
10:21:23  * Flynnnjoined
10:21:47  <russellw>Looking at parser generators available in node, the main ones seem to be Jison, PEG and nearley; is this correct? Which is the best one? Or, how could one go about choosing between them?
10:22:08  <LIERO>https://jsfiddle.net/vnqnvytp/
10:22:11  <plexigras>alextes, i want to diff text i already know what im gonna use for json diffing
10:22:19  <LIERO>can I use filters like this in Node?
10:22:38  <LIERO>when I log the whole array it´s fine, but for some reason it fails at the filter
10:23:32  <alextes>plexigras this one looks nice too: https://github.com/millermedeiros/disparity
10:23:52  <alextes>plexigras but really it's easier if you do the looking through the list yourself, you know what you want better than I ;]
10:24:28  * jazzhands1quit (Ping timeout: 240 seconds)
10:24:53  <plexigras>:D the disparity package looks nice then the one i tried https://www.npmjs.com/package/ansidiff
10:25:17  * mylesborinsquit (Quit: farewell for now)
10:25:28  <alextes>LIERO it fails because you're missing a semicolon.
10:25:32  <alextes>Have you tried using a linter?
10:25:48  * mylesborinsjoined
10:25:51  <alextes>plexigras: spoilers, disparity is using ansidiff :p
10:25:58  * Silencedquit (Ping timeout: 256 seconds)
10:26:08  <cart_man>I am having a hard time finding a way to make the browser dump JPG data that it just received back into a virtual file to give it a image.src to display
10:26:09  <alextes>but I think someone agreed with you
10:27:08  * mezodjoined
10:27:20  <alextes>LIERO actually let me check again, my ASI is rusty.
10:27:36  <LIERO>i´m not sure it´s a semicolon
10:27:44  <alextes>LIERO ah yea, works just fine.
10:28:07  * savantgardejoined
10:28:31  <LIERO>it does?
10:28:40  <alextes>@ecmabot ciu filter
10:28:51  <alextes>!caniuse filter
10:28:52  <ecmabot>alextes: Found: svg-filters, svg-html, css-backdrop-filter, css-filters, input-file-accept, css-touch-action, es5, css-filter-function (1 more...)
10:28:56  <alextes>pfff
10:29:04  <LIERO>weird thing is I´m not getting an error or anything
10:29:28  <LIERO>it just stops executing
10:29:54  <alextes>what are you running it on?
10:30:15  <LIERO>you mean OS?
10:30:27  <alextes>no, browser, node, jsfiddle?
10:30:37  <LIERO>node
10:32:14  * Silencedjoined
10:32:16  * savantgardequit (Remote host closed the connection)
10:33:06  <alextes>version LIERO?
10:33:23  <LIERO>4.4.7
10:35:22  * cootquit (Quit: coot)
10:35:35  * adlerdias__joined
10:35:48  <alextes>LIERO yea Array.prototype.filter is not even in the compatibility table. Works just fine for me.
10:35:55  <alextes>The exact code you pasted.
10:36:13  <LIERO>weird
10:36:17  <alextes>I really have to head for lunch now but maybe you can describe more precisely what you're doing?
10:36:23  * Cabanossiquit (Ping timeout: 245 seconds)
10:36:46  * zetajoined
10:36:53  * Delta-Onequit (Read error: Connection reset by peer)
10:37:08  * melvsterjoined
10:37:12  * bongjovijoined
10:37:13  * LiftLeftquit (Ping timeout: 245 seconds)
10:37:14  * Delta-Onejoined
10:37:58  <LIERO>ya, just one sec
10:38:37  * Silencedquit (Ping timeout: 260 seconds)
10:38:53  <alextes>Also here is a much cleaner example: https://gist.github.com/AlexTes/ff9f8179cb3e895413b287614225a6fc
10:39:16  * savantgardejoined
10:39:23  * Cabanossijoined
10:40:02  <alextes>Here's a small guide I wrote to setting up ESLint. It could help you avoid things like using loose equality comparison instead of strict equality comparison.
10:40:03  <alextes>https://gist.github.com/AlexTes/cf2163e7a65ba514259db74139533b2b
10:40:36  * horseyquit (Remote host closed the connection)
10:40:57  * EricBladequit (Quit: Leaving.)
10:41:04  * horseyjoined
10:41:12  * kingarmadillojoined
10:41:18  <russellw>Or, shameless plug, what's better than a tool for reporting issues? One that fixes them automatically! https://www.npmjs.com/package/jsclean
10:41:25  <zeta>alextes, do you think it's better to write if(foo === undefined || foo === null) instead of just if(foo == undefined) ?
10:41:52  <kakashiAL>what is a "non-HTTP-compatible character" ?
10:42:06  * the_ant1joined
10:42:59  * the_antquit (Ping timeout: 258 seconds)
10:43:00  * the_ant1changed nick to the_ant
10:43:35  * conmaxoquit (Quit: Leaving)
10:43:51  * Silencedjoined
10:44:15  * chalker_joined
10:44:27  * conmaxojoined
10:46:05  * kingarmadilloquit (Ping timeout: 240 seconds)
10:46:17  * cootjoined
10:46:53  <LIERO>hm
10:46:57  * duckpupp1joined
10:47:01  <LIERO>with the example object, it works fine
10:47:14  <LIERO>but with my object it doesn´t, although the structure is 1:1 the same
10:47:28  <LIERO>if I console.log(entireobject) it´s fine
10:47:35  <LIERO>but entireobject.data is undefined
10:47:37  <LIERO>o_o
10:47:55  * nya_joined
10:47:59  * Narigoquit (Quit: This computer has gone to sleep)
10:48:50  * not-an-aardvarkquit (Quit: Connection closed for inactivity)
10:49:06  * hextileXquit (Ping timeout: 240 seconds)
10:50:17  * xallquit (Ping timeout: 260 seconds)
10:50:45  * pinkkisquit (Ping timeout: 260 seconds)
10:51:02  * zetaquit (Quit: Leaving)
10:53:33  * nya_quit (Ping timeout: 260 seconds)
10:58:51  * hextileXjoined
10:59:19  * barduckjoined
10:59:53  * quakephiljoined
11:00:03  * tlaxkitjoined
11:00:38  * Industrialjoined
11:02:42  * savantgardequit (Remote host closed the connection)
11:03:10  <LIERO>it´s because it´s a string
11:03:34  <LIERO>i read it from a file and it comes out as a string instead of an object
11:04:00  <LIERO>but JSON.parse(data) doesn´t work - unexpected token: ?
11:05:41  * EyePulpjoined
11:05:59  * Ergojoined
11:06:33  * ThePendulumjoined
11:06:57  * plutoniixquit (Quit: Leaving)
11:07:19  * pinkkisjoined
11:10:05  * EyePulpquit (Ping timeout: 240 seconds)
11:15:42  * sibaquit (Quit: Textual IRC Client: www.textualapp.com)
11:17:44  <alextes>haha, nice russellw, but why not just contribute to ESLint? It has autofixing.
11:18:52  <russellw>alextes, it does? I didn't know that. Does it have an option to sort function declarations and switch cases in alphabetical order?
11:19:06  * joyeequit (Remote host closed the connection)
11:19:41  * joyeejoined
11:20:05  <kakashiAL>what is a "non-HTTP-compatible character", can anyone help please
11:21:06  * cootquit (Ping timeout: 240 seconds)
11:21:32  <alextes>russellw some rules have autofixing. it comes out when using the `--fix` flag. Not sure which rules enforce the two styles you're talking about. Nor how exactly to find if they have accompanying auto fixing. But maybe!
11:22:11  <alextes>LIERO always paste code as close to the real thing as possible. simplifying easily sneaks in bugs.
11:22:53  <LIERO>right, can´t simulate fs.readFile in jsfiddle :)
11:22:56  <russellw>kakashiAL, I don't know, can you say something about context? Are you getting that in an error message somewhere?
11:23:11  <LIERO>in that line of thought, where do people usually post node examples?
11:23:23  <alextes>!paste @ LIERO
11:23:23  <ecmabot>LIERO: Show some code, but don't paste it on the channel. For frontend code (HTML/CSS/JS), you can provide a test case that we can run, so that we can help you: use https://jsfiddle.net , https://jsbin.com , https://repl.it/, or http://requirebin.com . For Node.js code, use sites like https://gist.github.com/, http://vpaste.net and https://bpaste.net .
11:23:41  <LIERO>ah
11:23:46  * cesconixquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:23:48  <alextes>I haven't found one I like yet to be honest.
11:23:48  * joyeequit (Ping timeout: 240 seconds)
11:26:24  <russellw>If using peg to create a parser, that creates an extra compiling step, foo.pegjs to foo.js. When it comes time to NPM publish the package, I'm guessing NPM doesn't know anything about peg, so do you just peg-compile off-line, then present NPM with foo.js as if you had written it by hand?
11:27:06  * Flynnnquit (Quit: Auf Wiedersehen!)
11:27:38  <kakashiAL>russellw: no, I mean if you are using Basic authentication, you are using base64 encoding. The reason for that is to encode non-http-compatible character into compatbile ones
11:28:26  * phajijoined
11:28:45  <russellw>kakashiAL, well base64 is designed to encode things into an extremely plain vanilla character set that nothing will mess up. Does that solve your problem?
11:29:28  <kakashiAL>russellw: no, because I dont know which characters could cause problems in an http header
11:29:48  <russellw>Well if you're using base64 then you don't need to know, just base64 everything.
11:29:52  * buckrockwellquit (Remote host closed the connection)
11:30:16  <kakashiAL>russellw: yes, but do you know something that could cause a problem?
11:30:16  * hextileXquit (Ping timeout: 246 seconds)
11:31:06  <russellw>No but if you want somewhere to start looking, try emoji, I think those are outside the BMP so if stuff will trip over anything, it's likely to trip over those
11:31:57  * m31271nquit (Ping timeout: 240 seconds)
11:32:33  <alextes>russellw I'm not sure about the answer to your question. It could be compared to compiling newer JS to older JS. The way babel does. Perhaps some of the guides on publishing compiled JS modules share some of the rationale about how to do that best.
11:32:45  <shoky>kakashiAL: http headers should be in latin1 charset generally (iso-8859-1)
11:33:18  * savantgardejoined
11:33:28  * bybbjoined
11:34:02  <kakashiAL>shoky: I guess I could get problems if I use spaces or ; in my username/password
11:34:54  <shoky>kakashiAL: spaces and ; are fine.. (at least as far as http is concerned)
11:35:48  * joyeejoined
11:35:57  * ^escquit (Ping timeout: 240 seconds)
11:36:16  <fnordbart>RFC 7230 suggests restricting header field content to US-ASCII
11:36:32  <fnordbart>Historically, HTTP has allowed field content with text in the ISO-8859-1 charset, supporting other charsets only through use of [RFC2047] encoding.
11:36:58  * samschjoined
11:37:34  * rakesh1988quit (Ping timeout: 240 seconds)
11:37:56  <russellw>alextes, thanks, good call. I found https://booker.codes/how-to-build-and-publish-es6-npm-modules-today-with-babel/ which is a pretty good overview. And it seems to be saying node has a feature where it will do the compiling step for you if you tell it what command to use
11:39:25  * Narigojoined
11:40:03  <alextes>russellw I think you mean 'npm'. And yes, the 'prepublish' script :]
11:40:25  * flopsecquit (Quit: https://fnordserver.eu)
11:40:28  * WizJinquit (Ping timeout: 240 seconds)
11:40:35  <alextes>You will find more information about it in npm's docs
11:41:24  * Urbanyquit (Quit: https://fnordserver.eu)
11:43:35  * heraxquit (Ping timeout: 246 seconds)
11:43:44  * esc-apejoined
11:43:46  * ^escjoined
11:45:27  * horseyquit (Ping timeout: 240 seconds)
11:48:35  * tymczenkojoined
11:49:59  * devcjoined
11:50:06  * mr-foobarquit (Quit: Leaving...)
11:50:06  * HoierMjoined
11:50:47  * ChrisMorganquit (Ping timeout: 260 seconds)
11:51:09  * Kitujoined
11:51:26  * ChrisMorganjoined
11:51:35  * the_ant1joined
11:51:57  * duckpupp1quit (Ping timeout: 240 seconds)
11:52:00  * blessYahujoined
11:52:33  * SachaCRjoined
11:52:34  * the_antquit (Ping timeout: 264 seconds)
11:52:35  * the_ant1changed nick to the_ant
11:53:02  * cesconixjoined
11:54:05  * bybbquit
11:56:07  * undertugajoined
11:56:50  * flopsecjoined
11:56:50  * martisjquit (Quit: Textual IRC Client: www.textualapp.com)
11:58:05  * samschquit (Quit: Leaving)
11:58:37  * horseyjoined
11:59:31  * duckpupp1joined
12:00:14  * WizJinjoined
12:01:04  * hextileXjoined
12:01:44  * Urbanyjoined
12:01:59  * samschjoined
12:02:32  * the_ant1joined
12:04:01  * the_antquit (Ping timeout: 260 seconds)
12:04:01  * the_ant1changed nick to the_ant
12:04:53  * conmaxoquit (Quit: Leaving)
12:06:52  * dissapointedquit (Ping timeout: 268 seconds)
12:07:04  * horsey_joined
12:07:42  * Cabanossiquit (Ping timeout: 258 seconds)
12:08:05  * MrAbaddonquit (Ping timeout: 258 seconds)
12:08:20  * MrAbaddonjoined
12:08:50  * horseyquit (Read error: Connection reset by peer)
12:08:53  * Cabanossijoined
12:10:08  * nya_joined
12:12:38  * savantgardequit (Remote host closed the connection)
12:13:10  * mezodquit (Remote host closed the connection)
12:14:35  * chippingquit (Ping timeout: 240 seconds)
12:14:43  * nya_quit (Ping timeout: 246 seconds)
12:17:14  * brent__joined
12:17:51  * chippingjoined
12:18:42  * savantgardejoined
12:18:44  * MrAbaddonquit (Ping timeout: 256 seconds)
12:19:31  * qbicjoined
12:20:22  * buckrockwelljoined
12:22:18  * brent__quit (Ping timeout: 268 seconds)
12:24:16  * SachaCRquit (Quit: leaving)
12:25:10  * qbicquit (Quit: Textual IRC Client: www.textualapp.com)
12:25:39  * cesconixquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:25:57  * the_antquit (Ping timeout: 240 seconds)
12:27:10  * mrkmgjoined
12:27:32  * StoBrendojoined
12:28:23  * ohmyfromagejoined
12:29:03  * tyljoined
12:29:15  * ohmyfromagequit (Read error: Connection reset by peer)
12:31:09  * a_thakurquit (Remote host closed the connection)
12:32:11  * cesconixjoined
12:34:34  * MrAbaddonjoined
12:38:40  * aniothjoined