Created
March 10, 2016 16:13
-
-
Save ajcrites/f402829005e9db28804b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const JSONStream = require("JSONStream"); | |
const AWS = require("aws-sdk"); | |
const csd = new AWS.CloudSearchDomain({endpoint: process.env.CSD_ENDPOINT, region: "us-east-1"}); | |
const writeFile = fs.createWriteStream("big.json"); | |
// const stringifier = JSONStream.stringify("[", ",", "]"); | |
const stringifier = JSONStream.stringify(); | |
stringifier.pipe(writeFile); | |
for (let i = 0; i < 10; i++) { | |
let fd = fs.openSync("/dev/urandom", "r"); | |
let buffer = new Buffer(1000000); | |
fs.readSync(fd, buffer, 0, 1000000); | |
stringifier.write({content: buffer.toString("hex")}); | |
} | |
stringifier.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment