csv-stringify
Advanced tools
Comparing version 2.0.0 to 2.0.1
# Changelog | ||
## Version 2.0.1 | ||
* package: new release workflow | ||
* formatters: validate returned value | ||
## 2.0.0 | ||
This major version use CoffeeScript 2 which produces a modern JavaScript syntax | ||
(ES6, or ES2015 and later) and break the compatibility with versions of Node.js | ||
lower than 7.6 as well as the browsers. It is however stable in term of API. | ||
* package: use CoffeeScript 2 | ||
## v1.1.0 | ||
@@ -5,0 +18,0 @@ |
@@ -16,9 +16,7 @@ // Generated by CoffeeScript 2.0.1 | ||
// Callback approach, for ease of use: | ||
// This module export a function as its main entry point and return a transform | ||
// stream. | ||
// `stringify(data, [options], callback)` | ||
// Stream API, for maximum of power: | ||
// `stringify([options], [callback])` | ||
// Refers to the [official prject documentation](http://csv.adaltas.com/stringify/) | ||
// on how to call this function. | ||
module.exports = function() { | ||
@@ -84,2 +82,15 @@ var callback, chunks, data, options, stringifier; | ||
// You can also use *util.promisify* native function (Node.js 8+) in order to wrap callbacks into promises for more convenient use when source is a readable stream and you are OK with storing entire result set in memory: | ||
// ``` | ||
// const { promisify } = require('util'); | ||
// const csv = require('csv'); | ||
// const stringifyAsync = promisify(csv.stringify); | ||
// //returns promise | ||
// function generateCsv(sourceData) { | ||
// return stringifyAsync(sourceData); | ||
// } | ||
// ``` | ||
// ## `Stringifier([options])` | ||
@@ -321,2 +332,5 @@ | ||
if (field) { | ||
if (typeof field !== 'string') { | ||
return this.emit('error', Error('Formatter must return a string, null or undefined')); | ||
} | ||
containsdelimiter = field.indexOf(delimiter) >= 0; | ||
@@ -323,0 +337,0 @@ containsQuote = field.indexOf(quote) >= 0; |
{ | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"name": "csv-stringify", | ||
"description": "CSV stringifier implementing the Node.js `stream.Transform` API", | ||
"keywords": [ "csv", "stringify", "stringifier" ], | ||
"keywords": [ | ||
"csv", | ||
"stringify", | ||
"stringifier" | ||
], | ||
"license": "BSD-3-Clause", | ||
@@ -24,6 +28,12 @@ "repository": { | ||
"scripts": { | ||
"preversion": "grep '## Trunk' CHANGELOG.md && rm -rf lib && npm test", | ||
"version": "version=`grep '^ \"version\": ' package.json | sed 's/.*\"\\([0-9\\.]*\\)\".*/\\1/'` && sed -i \"s/## Trunk/## Version $version/\" CHANGELOG.md && git add CHANGELOG.md", | ||
"postversion": "git push && git push --tags && npm publish", | ||
"patch": "npm version patch -m 'Bump to version %s'", | ||
"minor": "npm version minor -m 'Bump to version %s'", | ||
"major": "npm version major -m 'Bump to version %s'", | ||
"coffee": "./node_modules/.bin/coffee -b -o lib src", | ||
"pretest": "./node_modules/.bin/coffee -b -o lib src", | ||
"test": "NODE_ENV=test ./node_modules/.bin/mocha test/**/*.coffee" | ||
"test": "./node_modules/.bin/mocha test/**/*.coffee" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18683
411
10