New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aternus/csv-to-xlsx

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aternus/csv-to-xlsx - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

11

CHANGELOG.md

@@ -16,2 +16,13 @@ # Changelog

## [1.0.2] - 2018-09-18
### Added
- Added sections to README.md.
### Changed
- Updated the package description.
- Updated the publish script.
### Fixed
- NPM bin.
## [1.0.1] - 2018-09-17

@@ -18,0 +29,0 @@ ### Changed

1

dist/csv-to-xlsx.js

@@ -0,1 +1,2 @@

#!/usr/bin/env node
"use strict";const path=require("path");const fs=require("fs-extra");const program=require("commander");const convertCsvToXlsx=require("./convertCsvToXlsx");if(module.parent){module.exports=convertCsvToXlsx}else{const pkg=require("../package");program.version(pkg.version,"-v, --version").option("-i, --input-dir [dir]","Input directory that has the CSV files","csv").option("-o, --output-dir [dir]","Output directory for the XLSX files","xlsx");program.on("--help",function(){console.log(``);console.log(`Created by: ${pkg.author}`);console.log(`Please report bugs at: ${pkg.bugs.url}`)});program.parse(process.argv);const csvPath=path.join(process.cwd(),program.inputDir);const xlsxPath=path.join(process.cwd(),program.outputDir);if(!fs.existsSync(csvPath)){console.error(`Invalid input directory: ${csvPath}\n`);process.exitCode=1;program.help()}if(!fs.existsSync(xlsxPath)){console.info(`Creating output directory: ${xlsxPath}`);fs.mkdirpSync(xlsxPath)}const csvFiles=fs.readdirSync(csvPath);for(let file of csvFiles){const fileObject=path.parse(file);if(fileObject.ext!==".csv"){continue}console.info(`Converting: ${fileObject.name}`);try{convertCsvToXlsx(path.join(csvPath,file),path.join(xlsxPath,`${fileObject.name}.xlsx`))}catch(e){console.info(`${e.toString()}`)}}console.log(`Complete.`)}

15

package.json
{
"name": "@aternus/csv-to-xlsx",
"version": "1.0.1",
"description": "Node.js command-line tool and a library to convert CSV files to XLSX (Excel 2007+ XML Format) files.",
"version": "1.0.2",
"description": "Command-line tool and a Node.js library to convert CSV files to XLSX (Excel 2007+ XML Format) files.",
"keywords": [

@@ -13,10 +13,11 @@ "convert",

"multilingual",
"batch"
"batch",
"cli",
"windows",
"linux",
"macos"
],
"main": "dist/csv-to-xlsx.js",
"bin": {
"csv-to-xlsx": "dist/csv-to-xlsx.js",
"csv-to-xlsx-win": "bin/csv-to-xlsx-win.exe",
"csv-to-xlsx-linux": "bin/csv-to-xlsx-linux",
"csv-to-xlsx-macos": "bin/csv-to-xlsx-macos"
"csv-to-xlsx": "dist/csv-to-xlsx.js"
},

@@ -23,0 +24,0 @@ "scripts": {

# @aternus/csv-to-xlsx
Convert CSV files to XLSX (Excel 2007+ XML Format).
Command-line tool to convert CSV files to XLSX (Excel 2007+ XML Format) files written in JavaScript.
Precompiled binaries (see the `bin` folder) are available for:
- Windows x64
- Linux x64
- MacOS
## Installation

@@ -15,35 +20,35 @@

### CLI
### Precompiled Binary (Command-line)
@TODO
```bash
./csv-to-xlsx-linux -i "input-directory" -o "output-directory"
```
### Node.js
### Node.js CLI
@TODO
Type `--help` for a full list of options.
```javascript
```bash
npx csv-to-xlsx -i "input-directory" -o "output-directory"
```
### Node.js
## Example
```javascript
const path = require('path');
const convertCsvToXlsx = require('@aternus/csv-to-xlsx');
@TODO
let source = path.join(__dirname, 'SalesJan2009.csv');
let destination = path.join(__dirname, 'converted_report.xlsx');
try {
convertCsvToXlsx(source, destination);
} catch (e) {
console.error(e.toString());
}
```
## FAQ
## Options
## Credits
## License
Released under the MIT License - see `LICENSE.md` for details.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc