UNPKG

1.32 kBJavaScriptView Raw
1#!/usr/bin/env node
2"use strict";
3Object.defineProperty(exports, "__esModule", { value: true });
4const yargs = require("yargs");
5const script_1 = require("../script");
6const ndjsonMap_1 = require("../stream/ndjson/ndjsonMap");
7script_1.runScript(async () => {
8 const { in: inputFilePath, out: outputFilePath, mapper: mapperFilePath, logEveryInput, logEveryOutput, limitInput, limitOutput, } = yargs.options({
9 in: {
10 type: 'string',
11 demandOption: true,
12 desc: 'Input ndjson file path',
13 },
14 out: {
15 type: 'string',
16 desc: 'Output ndjson file path',
17 demandOption: true,
18 },
19 mapper: {
20 type: 'string',
21 desc: 'Mapper file path',
22 demandOption: true,
23 },
24 logEveryInput: {
25 type: 'number',
26 default: 1000,
27 },
28 logEveryOutput: {
29 type: 'number',
30 default: 100000,
31 },
32 limitInput: {
33 type: 'number',
34 },
35 limitOutput: {
36 type: 'number',
37 },
38 }).argv;
39 await ndjsonMap_1.ndjsonMap({
40 inputFilePath,
41 outputFilePath,
42 mapperFilePath,
43 logEveryInput,
44 logEveryOutput,
45 limitInput,
46 limitOutput,
47 });
48});