Skip to content

Instantly share code, notes, and snippets.

@jblanche
Last active May 4, 2017 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jblanche/32b8057423d1b368c078344a2ceb341b to your computer and use it in GitHub Desktop.
Save jblanche/32b8057423d1b368c078344a2ceb341b to your computer and use it in GitHub Desktop.
esnextbin sketch
<!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>
// 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'
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
}
}
'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