file-saver
Advanced tools
Comparing version 1.3.3 to 1.3.4
{ | ||
"name": "file-saver", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "An HTML5 saveAs() FileSaver implementation", | ||
"main": "FileSaver.js", | ||
"main": "dist/FileSaver.js", | ||
"module": "src/FileSaver.js", | ||
"files": [ | ||
"dist/FileSaver.min.js" | ||
], | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 0", | ||
"build": "node_modules/.bin/uglifyjs FileSaver.js --mangle --comments /@source/ > FileSaver.min.js" | ||
"build:development": "mkdir -p dist && babel src/FileSaver.js --out-file=dist/FileSaver.js", | ||
"build:production": "NODE_ENV=production npm run build:development -- --out-file=dist/FileSaver.min.js", | ||
"build": "npm run build:development && npm run build:production", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -26,4 +33,7 @@ "repository": { | ||
"devDependencies": { | ||
"uglify-js": "^2.6.2" | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-transform-es2015-modules-umd": "^6.24.1", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-minify": "^0.2.0" | ||
} | ||
} |
@@ -35,2 +35,3 @@ If you need to save really large files bigger then the blob's size limitation or don't have | ||
| Safari < 6 | data: URI | No | n/a | [Blob.js](https://github.com/eligrey/Blob.js) | | ||
| Safari 10.1+ | Blob | Yes | n/a | None | | ||
@@ -71,2 +72,9 @@ Feature detection is possible: | ||
### Saving text using require | ||
```js | ||
var FileSaver = require('file-saver'); | ||
var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); | ||
FileSaver.saveAs(blob, "hello world.txt"); | ||
``` | ||
### Saving text | ||
@@ -76,3 +84,3 @@ | ||
var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); | ||
saveAs(blob, "hello world.txt"); | ||
FileSaver.saveAs(blob, "hello world.txt"); | ||
``` | ||
@@ -105,3 +113,3 @@ | ||
var file = new File(["Hello, world!"], "hello world.txt", {type: "text/plain;charset=utf-8"}); | ||
saveAs(file); | ||
FileSaver.saveAs(file); | ||
``` | ||
@@ -120,15 +128,2 @@ | ||
Contributing | ||
------------ | ||
The `FileSaver.js` distribution file is compiled with Uglify.js like so: | ||
```bash | ||
uglifyjs FileSaver.js --mangle --comments /@source/ > FileSaver.min.js | ||
# or simply: | ||
npm run build | ||
``` | ||
Please make sure you build a production version before submitting a pull request. | ||
Installation | ||
@@ -141,1 +136,7 @@ ------------------ | ||
``` | ||
Additionally, TypeScript definitions can be installed via: | ||
```bash | ||
npm install @types/file-saver --save-dev | ||
``` |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
137
15735
4
5
177
1
1