tle2文件转czml文件
This commit is contained in:
2
node_modules/node-xlsx/lib/bin/cli.d.ts
generated
vendored
Normal file
2
node_modules/node-xlsx/lib/bin/cli.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
#! /usr/bin/env node
|
||||
export {};
|
||||
34
node_modules/node-xlsx/lib/bin/cli.js
generated
vendored
Normal file
34
node_modules/node-xlsx/lib/bin/cli.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
#! /usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const promises_1 = require("fs/promises");
|
||||
const __1 = require("./..");
|
||||
const [action = 'build', ...args] = process.argv.slice(2);
|
||||
const readStdin = async (bufferSize) => {
|
||||
return new Promise((resolve) => {
|
||||
const buffers = [];
|
||||
process.stdin.on('readable', () => {
|
||||
const read = process.stdin.read();
|
||||
if (read) {
|
||||
buffers.push(read);
|
||||
}
|
||||
});
|
||||
process.stdin.on('end', () => {
|
||||
resolve(Buffer.concat(buffers, bufferSize));
|
||||
});
|
||||
});
|
||||
};
|
||||
const main = async () => {
|
||||
switch (action) {
|
||||
case 'build': {
|
||||
const stdin = JSON.parse((await readStdin()).toString('utf8'));
|
||||
const result = (0, __1.build)(stdin);
|
||||
await (0, promises_1.writeFile)(args[0] || `${process.cwd()}/out.xlsx`, result);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
console.log('Sorry, that is not something I know how to do.');
|
||||
}
|
||||
process.exit(0);
|
||||
};
|
||||
main();
|
||||
Reference in New Issue
Block a user