Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
js-client-file-downloader
Advanced tools
Readme
JS Client File Downloader is a simple package to download json, csv, pdf, docx, text files from client side(Browser).
JS File Downloader supports all browsers that are ES5-compliant (IE8 and below are not supported).
With a package manager (recomanded):
npm i js-client-file-downloader --save
import { jsFileDownloader } from "js-client-file-downloader";
var json = {
employee: {
name: "sonoo",
salary: 56000,
married: true
}
};
var filename = "testing";
//
function onOccuranceOfEvent() {
jsFileDownloader.makeJSON(obj, filename);
}
Suppose on Click method we want to initiate download files
//makeCSV() to make cvs file , An array has to be passed in this method as input
//ie , dataToBeDocumented= [{object},{object},{object}] format.
onClick(()=>{
jsFileDownloader.makeCSV(<dataToBeDocumented>, <testfileName>)
};
//makeJSON() to make json file , An string has to be passed in this method as input
//ie , dataToBeDocumented= {
// employee: {
// name: "sonoo",
// salary: 56000,
// married: true
// }}; format.
onClick(()=>{
jsFileDownloader.makeJSON(<dataToBeDocumented>, <testfileName>)
};
//makeTXT() to make json file , An string has to be passed in this method as input
//ie , dataToBeDocumented="string ..."; format.
onClick(()=>{
jsFileDownloader.makeTXT(<dataToBeDocumented>, <testfileName>)
};
//makeTXT() to make json file , A string has to be passed in this method as input
//ie , dataToBeDocumented="string ..."; format.
onClick(()=>{
jsFileDownloader.makeTXT(<dataToBeDocumented>, <testfileName>)
};
//makeSimplePDF() to make json file , A string has to be passed in this method as input
//ie , dataToBeDocumented="string ..."; format.
onClick(()=>{
jsFileDownloader.makeSimplePDF(<dataToBeDocumented>, <testfileName>)
};
//makeBasicDOCX() to make json file , A string has to be passed in this method as input
//ie , dataToBeDocumented="string ..."; format.
onClick(()=>{
jsFileDownloader.makeBasicDOCX(<dataToBeDocumented>, <testfileName>)
};
//for making advance PDF ie with header,picture..etc, use the following method
var pdf=jsFileDownloader.makeAdvPdf() //this method returns a instance of the jsPDF()
//for making advance DOCx ie with header,picture..etc, use the following method
var { docx, FileSaver }=jsFileDownloader.makeAdvDocX() //this method returns a instance of the docx,and fileSaver
output file name
pass the data that you want to create a file.
#Author
Copyright (c) 2019-present,Souvik Dey
Email : deysouvik955@gmail.com Github : https://github.com/svkdey
FAQs
download any data in any format on client side
The npm package js-client-file-downloader receives a total of 2 weekly downloads. As such, js-client-file-downloader popularity was classified as not popular.
We found that js-client-file-downloader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.