View gist:864ac93ff54c6845c36391d52b293d34
files yolo geegaw:~/dev/js/x/files node@v8.0.0-pre
$ tar tvf x-1.2.3.tgz
-rw-r--r-- 0 501 20 54 May 19 17:54 package/package.json
-rw-r--r-- 0 501 20 0 May 19 17:52 package/b
-rw-r--r-- 0 501 20 0 May 19 17:52 package/d
-rw-r--r-- 0 501 20 0 May 19 17:52 package/e
files yolo geegaw:~/dev/js/x/files node@v8.0.0-pre
$ cat package.json
{"name":"x","version":"1.2.3","files":["[b-e]","!c"]}
View gist:53704ae9cf2325aa100be8e794c1d0e4
isaacs@izs.me:~/irc/irc.freenode.net/#node.js node@v5.3.0
$ tail -f out
2017-05-18 18:57 <isaacs> it's quite a lot of work to be omniscient
2017-05-18 18:57 <lohfu> dont get me started
2017-05-18 18:58 <isaacs> like, if a number is in your phone, why should you waste time having to remember it?
2017-05-18 18:58 <lohfu> deep
2017-05-18 19:00 <isaacs> anyway, ii is pretty neat
2017-05-18 19:02 <isaacs> it makes a tree of folders in ~/irc, each with an 'in' and 'out' file. you can 'out' to read the channel, and write to 'in' to post a message.
2017-05-18 19:02 <isaacs> it's less an "irc client" and more a "framework for making irc clients"
2017-05-18 19:03 <isaacs> https://gist.github.com/isaacs/54e88bd6ed614768e4b3d658268243d9
View gist:54e88bd6ed614768e4b3d658268243d9
$ tree
.
└── irc.freenode.net/
├── chanserv/
│   ├── in|
│   └── out
├── #node.js/
│   ├── in|
│   └── out
├── #tap/
View gist:b0e8ea6dd23f0d2d24135aef18ff3bf6
> tar@2.2.1 bench /Users/isaacs/dev/js/tar
> for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done
benchmarks/create/node-tar-file-async.js
383.019676
359.974358
342.643618
358.384905
336.993626
benchmarks/create/node-tar-file-sync.js
View -Users-isaacs-.npm-_logs-2017-05-05T04_10_13_732Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'version',
1 verbose cli 'patch' ]
2 info using npm@5.0.0-beta.33
3 info using node@v8.0.0-pre
4 notice BETA npm5 is beta software. Please see https://github.com/npm/npm/issues/16510 for known issues, and please file a new one if you find something new.
5 info git [ 'status', '--porcelain' ]
6 info lifecycle spawn-wrap@1.3.5~preversion: spawn-wrap@1.3.5
View tar-convenience-api.md

The goal is to mimic the command line.

For create helper methods, pass in a list of files to add to the tarball.

If a file is specified, then write out to the file. Otherwise, return the stream, which can be piped wherever.

If no cb is provided, return a Promise. Actually, just return a Promise from creation helper methods no matter what, maybe?

View gist:5401f53e943d0c1a6ce29495485bdada
> tar@2.2.1 test /Users/isaacs/dev/js/tar
> tap test/*.js --100 -J
test/fields.js ...................................... 42/42
test/header.js ...................................... 37/37
test/large-numbers.js ............................... 20/20
test/load-all.js ...................................... 1/1 1s
test/parse.js ................................... 4360/4360
test/pax.js ........................................... 8/8
test/read-entry.js .................................. 10/10
View tar pack benchmarks.txt
Packing the npm package directory
Here's v1 node-tar. This is not fast.
$ for i in {1..10} ; do node op.js package ; done
2002.013
2023.063
1622.917
1645.278
1709.164
View gist:ce29ec1843992cd38d231ef87b5c78a9
# all times are in ms
# downloads.tar is my downloads folder, which is gigantic because i'm lazy
# and never delete anything out of it.
$ ls -laF downloads.tar
-rw-r--r-- 1 isaacs staff 6552657408 Mar 23 23:54 downloads.tar
# read synchronously and writes to an extractor that does all sync fs operations
$ node es-sync2.js downloads.tar
13734.368
# 13.7s, not bad
View no-parse.js
$ for TEST in old.js ts.js np3.js np3-seek.js np3-ignore.js no-parse.js; do echo ""; echo $TEST; for i in {1..5}; do node $TEST test/fixtures.tar >/dev/null; done; done
old.js
24.48
25.71
25.696
26.064
24.163
ts.js