Socket
Socket
Sign inDemoInstall

json-to-csv-in-browser

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-to-csv-in-browser - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

lib/download.d.ts

4

package.json
{
"name": "json-to-csv-in-browser",
"version": "1.0.0",
"version": "1.0.1",
"description": "This converts the json array in the browser to csv file that can be stored in disc",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"dev" : "tsc -p ."
},

@@ -9,0 +9,0 @@ "repository": {

@@ -1,1 +0,45 @@

# json-to-csv-in-browser
# json-to-csv-in-browser
This module creats the csv file inside the browser itself
supply jsonarray it will give back file of csv
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Test</h1>
<button id="btn">Click</button>
</body>
<script type="module"src="client.js" ></script>
</html>
```
```javascript
import {JsonArray, download} from "json-to-csv-in-browser"
mybtn = document.getElementById("btn").addEventListener("click",()=>{
let arr = [
{name : `umesh, bilsgai
sghg
susuus`, age : 53},
{name : "ramya", age : 38},
{name : "pradyu", age : 22}
]
let jsonArray = new JsonArray(arr);
let str = jsonArray.convertToCSVstring();
download("my.csv", str);
})
```

@@ -7,4 +7,4 @@ {

// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */

@@ -11,0 +11,0 @@ // "allowJs": true, /* Allow javascript files to be compiled. */

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