Package Exports
- csv-sort
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (csv-sort) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
csv-sort
Sorts double-entry bookkeeping CSV coming from internet banking
Other siblings of this package:
- CLI (command-line app) version: csv-sort-cli
Table of Contents
Install
$ npm i csv-sort
Here's what you'll get:
Type | Key in package.json |
Path | Size |
---|---|---|---|
Main export - CommonJS version, transpiled, contains require and module.exports |
main |
dist/csv-sort.cjs.js |
19 KB |
ES module build that Webpack/Rollup understands. Untranspiled ES6 code with import /export . |
module |
dist/csv-sort.esm.js |
19 KB |
UMD build for browsers, transpiled, minified, containing iife 's and has all dependencies baked-in |
browser |
dist/csv-sort.umd.js |
54 KB |
TLDR;
csv-sort
can correct the order of rows of any accounting CSV files that come in double entry bookkeeping format:
Currently (late 2017) Lloyds Bank website exports CSV files with some rows from the same day in a wrong order. This library is my attempt to to fix such CSV's.
This lib does two twings:
- Sorts rows in correct order that follows the double-entry format.
- Trims the empty columns and rows (so-called 2D-Trim^).
In later releases I would like to be able to recognise and fix any offset columns caused by misinterpreted commas as values.
^ 1D-Trim would be trim of a string. 3D-Trim would be some sort of spatial data trim.
Usage
const csvSort = require('csv-sort')
// ...
API
- Input - string
- Output - plain object:
output object | Type | Description |
---|---|---|
{ | ||
res |
Array | Array of arrays, each containing a column's value. |
msgContent |
String | This application outputs the messages here. |
msgType |
String | Can be either alert or info . That's similar to an icon on the hypothetical UI. |
} |
If the input is anything else than a string
, it will throw
.
If the input is an empty string, the output object's res
key will be equal to [['']]
.
Contributing
Hi! 99% of people in the society are passive - consumers. They wait for others to take action, they prefer to blend in. The remaining 1% are proactive citizens who will do something rather than wait. If you are one of that 1%, you're in luck because I am the same and together we can make something happen.
If you want a new feature in this package or you would like to change some of its functionality, raise an issue on this repo. Also, you can email me. Just let it out.
If you tried to use this library but it misbehaves, or you need an advice setting it up, and its readme doesn't make sense, just document it and raise an issue on this repo. Alternatively, you can email me.
If you don't like the code in here and would like to give an advice about how something could be done better, please do. Same drill - GitHub issues or email, your choice.
If you would like to add or change some features, just fork it, hack away, and file a pull request. I'll do my best to merge it quickly. Code style is
airbnb
, only without semicolons. If you use a good code editor, it will pick up the established ESLint setup.
Licence
MIT License (MIT)
Copyright © 2017 Codsen Ltd, Roy Revelt
List of currency signs - Copyright © 2017 Ben Gourley - see its BSD-2-Clause disclaimer