Comparing version 9.0.11 to 10.0.0
{ | ||
"name": "filesize", | ||
"description": "JavaScript library to generate a human readable String describing the file size", | ||
"version": "9.0.11", | ||
"version": "10.0.0", | ||
"homepage": "https://filesizejs.com", | ||
@@ -15,32 +15,32 @@ "author": "Jason Mulligan <jason.mulligan@avoidwork.com>", | ||
"files": [ | ||
"lib", | ||
"*.d.ts" | ||
"dist", | ||
"types" | ||
], | ||
"license": "BSD-3-Clause", | ||
"browser": "lib/filesize.min.js", | ||
"main": "lib/filesize.js", | ||
"module": "lib/filesize.esm.js", | ||
"types": "filesize.d.ts", | ||
"browser": "dist/filesize.min.js", | ||
"main": "dist/filesize.cjs", | ||
"module": "dist/filesize.esm.js", | ||
"types": "types/filesize.d.ts", | ||
"type": "module", | ||
"sourceType": "module", | ||
"engines": { | ||
"node": ">= 0.4.0" | ||
"node": ">= 16.0.0" | ||
}, | ||
"scripts": { | ||
"build": "rollup -c", | ||
"watch": "rollup -c -w", | ||
"build": "mkdir -p dist && rm -rf dist/* && npm run rollup", | ||
"changelog": "auto-changelog -p", | ||
"test": "npm run build && npm run lint && npm run test:unit && npm run test:type", | ||
"test:unit": "nodeunit test/filesize_test.js", | ||
"test:type": "tsc -p test", | ||
"lint": "eslint test/*.js src/*.js" | ||
"coverage": "nyc npm run test", | ||
"lint": "eslint *.js src/*.js test/*.js", | ||
"mocha": "mocha test/*.js", | ||
"rollup": "rollup --config", | ||
"test": "npm run lint && npm run mocha", | ||
"types": "npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --outDir types" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.18.5", | ||
"@babel/preset-env": "^7.18.2", | ||
"auto-changelog": "^2.4.0", | ||
"eslint": "^8.17.0", | ||
"nodeunit-x": "^0.15.0", | ||
"rollup": "^2.75.6", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"eslint": "^8.24.0", | ||
"mocha": "^10.0.0", | ||
"rollup": "^2.79.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"typescript": "^4.7.3" | ||
"typescript": "^4.8.4" | ||
}, | ||
@@ -47,0 +47,0 @@ "keywords": [ |
# filesize.js | ||
[![build status](https://secure.travis-ci.org/avoidwork/filesize.js.svg)](http://travis-ci.org/avoidwork/filesize.js) [![downloads](https://img.shields.io/npm/dt/filesize.svg)](https://www.npmjs.com/package/filesize) [![CDNJS version](https://img.shields.io/cdnjs/v/filesize.svg)](https://cdnjs.com/libraries/filesize) | ||
[![downloads](https://img.shields.io/npm/dt/filesize.svg)](https://www.npmjs.com/package/filesize) [![CDNJS version](https://img.shields.io/cdnjs/v/filesize.svg)](https://cdnjs.com/libraries/filesize) | ||
filesize.js provides a simple way to get a human readable file size string from a number (float or integer) or string. | ||
```javascript | ||
import {filesize} from "filesize"; | ||
filesize(265318, {base: 2, standard: "jedec"}); // "259.1 KB" | ||
``` | ||
## Optional settings | ||
@@ -61,3 +66,3 @@ | ||
## Partial Application | ||
`filesize.partial()` takes the second parameter of `filesize()` and returns a new function with the configuration applied | ||
`partial()` takes the second parameter of `filesize()` and returns a new function with the configuration applied | ||
upon execution. This can be used to reduce `Object` creation if you call `filesize()` without caching the `descriptor` | ||
@@ -67,3 +72,4 @@ in lexical scope. | ||
```javascript | ||
const size = filesize.partial({base: 2, standard: "jedec"}); | ||
import {partial} from "filesize"; | ||
const size = partial({base: 2, standard: "jedec"}); | ||
@@ -73,9 +79,4 @@ size(265318); // "259.1 KB" | ||
## How can I load filesize.js? | ||
filesize.js supports AMD loaders (require.js, curl.js, etc.), node.js & npm (```npm install filesize```), or using a script tag. | ||
An ES6 version is bundled with an npm install, but requires you load it with the full path, e.g. `require(path.join(__dirname, 'node_modules', 'filesize', 'lib', 'filesize.es6.js'))`. | ||
## License | ||
Copyright (c) 2022 Jason Mulligan | ||
Licensed under the BSD-3 license. |
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
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
6
80
Yes
48661
12
1