Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d9ee930204 | |||
| abfeea00ec | |||
| b7333cc184 | |||
| 338d2033bb | |||
| ad92cd2899 | |||
| 3a0191a5d6 |
10
Dockerfile
10
Dockerfile
@@ -11,6 +11,12 @@ WORKDIR /app
|
||||
|
||||
COPY . /app
|
||||
|
||||
RUN yarn
|
||||
RUN npm install
|
||||
|
||||
CMD [ "node" , "index.js"]
|
||||
RUN npm link
|
||||
|
||||
RUN ln -s $(which excel2json-xlsx) /usr/bin/x2j
|
||||
|
||||
ENTRYPOINT [ "/usr/bin/x2j"]
|
||||
|
||||
CMD [ "--help" ]
|
||||
2
Makefile
2
Makefile
@@ -9,7 +9,7 @@ run:
|
||||
docker run --rm -t ${DOCKER_IMAGE}
|
||||
|
||||
publish:
|
||||
@echo "Pubishing docker image..."
|
||||
@echo "Publishing docker image..."
|
||||
docker push ${DOCKER_IMAGE}
|
||||
|
||||
.PHONY: build
|
||||
|
||||
12
bin/cli.js
12
bin/cli.js
@@ -29,12 +29,18 @@ const options = yargs
|
||||
type: "string",
|
||||
demandOption: false,
|
||||
})
|
||||
.argv;
|
||||
.option("p", {
|
||||
alias: "print",
|
||||
describe: "Print the exported json to console",
|
||||
type: "boolean",
|
||||
demandOption: false,
|
||||
}).argv;
|
||||
|
||||
const inputFile = options.input;
|
||||
const outputFile = options.output;
|
||||
const mapperFile = options.mapper;
|
||||
const sheetName = options.sheet;
|
||||
const print = options.print;
|
||||
|
||||
const exported = excel2json({
|
||||
inputFile: inputFile,
|
||||
@@ -42,3 +48,7 @@ const exported = excel2json({
|
||||
outputFile: outputFile,
|
||||
sheetName: sheetName,
|
||||
});
|
||||
|
||||
if (print) {
|
||||
console.log(exported);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "excel2json-xlsx",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"keywords": [
|
||||
"excel",
|
||||
"json",
|
||||
|
||||
Reference in New Issue
Block a user