made with esnextbin
Last active
May 4, 2017 12:04
-
-
Save jblanche/32b8057423d1b368c078344a2ceb341b to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<h1>Classic</h1> | |
<pre id="classic"></pre> | |
<h1>Ours</h1> | |
<pre id="ours"></pre> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
// var json2csv = require('json2csv'); | |
const fields = ['id', 'newId', 'value'] | |
const data = [ | |
{ id: 1, value: 'foo' }, | |
{ id: 2, value: '"bar,baz"' }, | |
{ id: 3, value: '=-2+3+cmd|\' /C calc\'!A0' }, | |
] | |
// var classic = json2csv({ data: data, fields: fields}); | |
// var ours = json2csv({ data: data, fields: fields, quotes: '', doubleQuotes: '"""' }); | |
document.getElementById('classic').innerHTML = 'classic' | |
document.getElementById('ours').innerHTML = 'ours' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
// var json2csv = require('json2csv'); | |
var fields = ['id', 'newId', 'value']; | |
var data = [{ id: 1, value: 'foo' }, { id: 2, value: '"bar,baz"' }, { id: 3, value: '=-2+3+cmd|\' /C calc\'!A0' }]; | |
// var classic = json2csv({ data: data, fields: fields}); | |
// var ours = json2csv({ data: data, fields: fields, quotes: '', doubleQuotes: '"""' }); | |
document.getElementById('classic').innerHTML = 'classic'; | |
document.getElementById('ours').innerHTML = 'ours'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment