View gist:b20156c0091cc071453d455446a5b105
$ cat make-tar.js
'use strict'
const makeTar = require('./test/make-tar.js')
const fs = require('fs')
const data = makeTar([
{
type: 'SymbolicLink',
linkpath: './foo',
mode: 0o0644
View rename.js
'use strict'
const tar = require('./')
const fs = require('fs')
const rimraf = require('rimraf')
const mkdirp = require('mkdirp')
rimraf.sync('input')
rimraf.sync('output')
mkdirp.sync('input/foo')
mkdirp.sync('output/foo')
View servers.js
const http = require('http')
const firstServer = http.createServer((req, res) => {
console.log('firstServer request', req.url, req.headers)
res.setHeader('set-cookie', 'foo=bar; max-age=10000000; host=localhost:8080; SameSite=Strict')
res.setHeader('content-type', 'text/html')
res.write('<pre>')
res.write(JSON.stringify(req.headers, null, 2) + '\n</pre>')
View labeled-continue.js
'use strict'
let i = 0
OUTER: while (true) {
console.log('outer before', i)
INNER: while (true) {
i++
console.log('inner before', i)
if (i > 10)
View ok.js
'use strict'
const test = foo => {
switch (foo) {
case 'ok':
return console.log('this is fine')
/* istanbul ignore next */
default:
throw new Error('nope')
View gist:40a0eb142b13a72099e99faceaf4dafb
$ node -p 'require("../../js/npm-packlist").sync().join("\n")'
package.json
.mailmap
.npmignore
.tern-project
.travis.yml
appveyor.yml
AUTHORS
CHANGELOG.md
configure
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