Code files

This commit is contained in:
Akhil
2017-07-31 11:33:31 +05:30
parent 073a63ebdd
commit b9ae409ec0
801 changed files with 17535 additions and 0 deletions
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
Wed Jun 08 2016 23:48:13 GMT+0100 (BST) 896977 bytes removed
Wed Jun 08 2016 23:48:17 GMT+0100 (BST) 896977 bytes removed
Wed Jun 08 2016 23:49:25 GMT+0100 (BST) 896977 bytes removed
Wed Jun 08 2016 23:50:17 GMT+0100 (BST) 896977 bytes removed
@@ -0,0 +1,23 @@
'use strict'
setInterval(() => process.stdout.write('.'), 10).unref()
const fs = require('fs')
const path = require('path')
const cwd = process.cwd()
const sbs = require('strip-bytes-stream')
fs.createReadStream(path.join(cwd, 'file.dat'))
.pipe(sbs((n) => n))
.on('end', function () { log(this.total) })
.pipe(fs.createWriteStream(path.join(cwd, 'clean.dat')))
function log(total) {
fs.appendFile(
path.join(cwd, 'log.txt'),
(new Date) + ' ' + total + ' bytes removed\n'
)
}
@@ -0,0 +1,14 @@
{
"name": "piping",
"version": "1.0.0",
"description": "",
"main": "null-byte-remover.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "David Mark Clements",
"license": "MIT",
"dependencies": {
"strip-bytes-stream": "^1.1.0"
}
}