fs-gzip-blob-storage
Advanced tools
@@ -1,4 +0,3 @@ | ||
| /// <reference types="node" /> | ||
| import { Readable, Writable } from "stream"; | ||
| import zlib from "zlib"; | ||
| import { Readable, Writable } from "node:stream"; | ||
| import zlib from "node:zlib"; | ||
| import { FsBlobStorageCommitOptions, FsBlobStorageOptions, FsBlobStorageReadStreamOptions, FsBlobStorageRemoveOptions, FsBlobStorageWriteStreamOptions } from "fs-blob-storage"; | ||
@@ -5,0 +4,0 @@ export interface FsGzipBlobStorageOptions extends FsBlobStorageOptions { |
@@ -1,18 +0,12 @@ | ||
| "use strict"; | ||
| /// <reference types="node" /> | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.FsGzipBlobStorage = exports.DEFAULT_GZIP_EXT = exports.DEFAULT_PART = exports.DEFAULT_EXT = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const zlib_1 = tslib_1.__importDefault(require("zlib")); | ||
| const pumpify_1 = tslib_1.__importDefault(require("pumpify")); | ||
| const fs_blob_storage_1 = require("fs-blob-storage"); | ||
| var fs_blob_storage_2 = require("fs-blob-storage"); | ||
| Object.defineProperty(exports, "DEFAULT_EXT", { enumerable: true, get: function () { return fs_blob_storage_2.DEFAULT_EXT; } }); | ||
| Object.defineProperty(exports, "DEFAULT_PART", { enumerable: true, get: function () { return fs_blob_storage_2.DEFAULT_PART; } }); | ||
| exports.DEFAULT_GZIP_EXT = ".gz"; | ||
| class FsGzipBlobStorage { | ||
| import zlib from "node:zlib"; | ||
| import Pumpify from "pumpify"; | ||
| import { FsBlobStorage, DEFAULT_EXT, } from "fs-blob-storage"; | ||
| export { DEFAULT_EXT, DEFAULT_PART } from "fs-blob-storage"; | ||
| export const DEFAULT_GZIP_EXT = ".gz"; | ||
| export class FsGzipBlobStorage { | ||
| constructor(options = {}) { | ||
| this.storage = new fs_blob_storage_1.FsBlobStorage(options); | ||
| this.ext = options.ext !== undefined ? options.ext : fs_blob_storage_1.DEFAULT_EXT; | ||
| this.gzipExt = options.gzipExt !== undefined ? options.gzipExt : exports.DEFAULT_GZIP_EXT; | ||
| this.storage = new FsBlobStorage(options); | ||
| this.ext = options.ext !== undefined ? options.ext : DEFAULT_EXT; | ||
| this.gzipExt = options.gzipExt !== undefined ? options.gzipExt : DEFAULT_GZIP_EXT; | ||
| this.gzipOptions = options.gzipOptions || {}; | ||
@@ -25,4 +19,4 @@ } | ||
| const file = await this.storage.createWriteStream(key, newOptions); | ||
| const gzip = zlib_1.default.createGzip(this.gzipOptions); | ||
| return new pumpify_1.default(gzip, file); | ||
| const gzip = zlib.createGzip(this.gzipOptions); | ||
| return new Pumpify(gzip, file); | ||
| } | ||
@@ -34,4 +28,4 @@ async createReadStream(key, options = {}) { | ||
| const file = await this.storage.createReadStream(key, newOptions); | ||
| const gunzip = zlib_1.default.createGunzip(this.gzipOptions); | ||
| return new pumpify_1.default(file, gunzip); | ||
| const gunzip = zlib.createGunzip(this.gzipOptions); | ||
| return new Pumpify(file, gunzip); | ||
| } | ||
@@ -51,4 +45,2 @@ commit(key, options = {}) { | ||
| } | ||
| exports.FsGzipBlobStorage = FsGzipBlobStorage; | ||
| exports.default = FsGzipBlobStorage; | ||
| //# sourceMappingURL=fs-gzip-blob-storage.js.map | ||
| export default FsGzipBlobStorage; |
+1
-1
| MIT License | ||
| Copyright (c) 2018-2020 Piotr Roszatycki <piotr.roszatycki@gmail.com> | ||
| Copyright (c) 2018-2024 Piotr Roszatycki <piotr.roszatycki@gmail.com> | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of |
+48
-37
| { | ||
| "name": "fs-gzip-blob-storage", | ||
| "version": "3.0.1", | ||
| "version": "4.0.0", | ||
| "description": "Blob storage on filesystem, with gzip, streams and promises API", | ||
| "type": "module", | ||
| "exports": { | ||
| ".": { | ||
| "default": "./lib/fs-gzip-blob-storage.js", | ||
| "typings": "./lib/fs-gzip-blob-storage.d.ts" | ||
| } | ||
| }, | ||
| "main": "lib/fs-gzip-blob-storage.js", | ||
@@ -24,39 +31,42 @@ "typings": "lib/fs-gzip-blob-storage.d.ts", | ||
| "engines": { | ||
| "node": ">=10.0.0" | ||
| "node": ">=16.0.0" | ||
| }, | ||
| "dependencies": { | ||
| "fs-blob-storage": "^3.1.0", | ||
| "pumpify": "^2.0.1", | ||
| "tslib": "^2.0.2" | ||
| "fs-blob-storage": "^4.1.0", | ||
| "pumpify": "^2.0.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/chai": "^4.2.13", | ||
| "@types/dirty-chai": "^2.0.2", | ||
| "@types/mocha": "^8.0.3", | ||
| "@types/node": "^14.11.5", | ||
| "@types/pumpify": "^1.4.1", | ||
| "@typescript-eslint/eslint-plugin": "^4.4.0", | ||
| "@typescript-eslint/eslint-plugin-tslint": "^4.4.0", | ||
| "@typescript-eslint/parser": "^4.4.0", | ||
| "chai": "^4.2.0", | ||
| "changelog-parser": "^2.8.0", | ||
| "coveralls": "^3.1.0", | ||
| "cross-env": "^7.0.2", | ||
| "dirty-chai": "^2.0.1", | ||
| "eslint": "^7.10.0", | ||
| "eslint-config-prettier": "^6.12.0", | ||
| "eslint-plugin-import": "^2.22.1", | ||
| "eslint-plugin-jsdoc": "^30.6.3", | ||
| "eslint-plugin-node": "^11.1.0", | ||
| "markdownlint-cli": "^0.24.0", | ||
| "mocha": "^8.1.3", | ||
| "@eslint/js": "^9.5.0", | ||
| "@tsconfig/node16": "^16.1.3", | ||
| "@types/chai": "^4.3.16", | ||
| "@types/chai-as-promised": "^7.1.8", | ||
| "@types/core-js": "^2.5.8", | ||
| "@types/dns-packet": "^5.6.5", | ||
| "@types/eslint__js": "^8.42.3", | ||
| "@types/mocha": "^10.0.6", | ||
| "@types/node": "^20.14.7", | ||
| "@types/pumpify": "^1.4.4", | ||
| "@types/semver": "^7.5.8", | ||
| "@types/wtfnode": "^0.7.3", | ||
| "@typescript-eslint/parser": "^7.13.1", | ||
| "c8": "^10.1.2", | ||
| "chai": "^5.1.1", | ||
| "chai-as-promised": "^8.0.0", | ||
| "coveralls": "^3.1.1", | ||
| "dns-packet": "^5.6.1", | ||
| "eslint": "^8.57.0", | ||
| "eslint-config-prettier": "^9.1.0", | ||
| "markdownlint-cli": "^0.41.0", | ||
| "mocha": "^10.4.0", | ||
| "mocha-steps": "^1.3.0", | ||
| "nyc": "^15.1.0", | ||
| "prettier": "^2.1.2", | ||
| "promise-readable": "^6.0.0", | ||
| "promise-writable": "^6.0.0", | ||
| "shx": "^0.3.2", | ||
| "stream.pipeline-shim": "^1.1.0", | ||
| "ts-node": "^9.0.0", | ||
| "typescript": "^4.0.3" | ||
| "prettier": "^3.3.2", | ||
| "promise-readable": "^8.0.1", | ||
| "promise-writable": "^8.0.0", | ||
| "semver": "^7.6.2", | ||
| "shx": "^0.3.4", | ||
| "ts-node": "^10.9.2", | ||
| "tslib": "^2.6.3", | ||
| "typescript": "^5.5.2", | ||
| "typescript-eslint": "^7.13.1", | ||
| "wtfnode": "^0.9.2" | ||
| }, | ||
@@ -72,6 +82,5 @@ "scripts": { | ||
| "lint:tsc:test": "tsc --noEmit --pretty --project test", | ||
| "lint:eslint": "eslint --ext .js,.ts .", | ||
| "lint:eslint": "eslint .", | ||
| "lint:prettier": "prettier --ignore-path .gitignore --list-different '**/*.{js,json,md,ts,yml}'", | ||
| "lint:markdownlint": "markdownlint \"*.md\"", | ||
| "postpublish": "node -e \"require(\\\"changelog-parser\\\")(\\\"CHANGELOG.md\\\").then(ch => console.log(ch.versions.filter(v => v.version === \\\"$npm_package_version\\\").map(v => \\\"v$npm_package_version\\n\\n\\\" + v.body).concat(\\\"Release v$npm_package_version\\\")[0]))\" | xargs -0 git tag v$npm_package_version -a -m && git push --tags", | ||
| "prepack": "npm run compile", | ||
@@ -81,5 +90,7 @@ "prepublishOnly": "npm run test", | ||
| "test": "npm run test:spec", | ||
| "test:spec": "$NYC mocha \"test/*.ts\"", | ||
| "test:coverage": "npm run clean:coverage && cross-env NYC=\"nyc --no-clean --reporter=lcov\" npm run test:spec && nyc report --reporter=text-summary --color" | ||
| "test:spec": "mocha", | ||
| "test:coverage": "npm run test:coverage:spec && npm run test:coverage:report", | ||
| "test:coverage:spec": "c8 --no-clean --reporter=lcov npm run test:spec", | ||
| "test:coverage:report": "c8 report --reporter=text-summary --color" | ||
| } | ||
| } |
+27
-30
@@ -5,7 +5,11 @@ # fs-gzip-blob-storage | ||
| [](http://travis-ci.org/dex4er/js-fs-gzip-blob-storage) [](https://coveralls.io/github/dex4er/js-fs-gzip-blob-storage) [](https://www.npmjs.com/package/fs-gzip-blob-storage) | ||
| [](https://github.com/dex4er/js-fs-gzip-blob-storage) | ||
| [](https://github.com/dex4er/js-fs-gzip-blob-storage/actions/workflows/ci.yaml) | ||
| [](https://github.com/dex4er/js-fs-gzip-blob-storage/actions/workflows/trunk.yaml) | ||
| [](https://coveralls.io/github/dex4er/js-fs-gzip-blob-storage) | ||
| [](https://www.npmjs.com/package/fs-gzip-blob-storage) | ||
| <!-- markdownlint-enable MD013 --> | ||
| Blob storage on filesystem, with gzip, streams and promises API. | ||
| Blob storage on a filesystem, with gzip, streams and promises API. | ||
@@ -17,3 +21,3 @@ This is a wrapper for | ||
| This module requires ES6 with Node >= 10. | ||
| This module requires ES6 with Node >= 16. | ||
@@ -35,11 +39,3 @@ ## Installation | ||
| ```js | ||
| const {FsGzipBlobStorage} = require("fs-gzip-blob-storage") | ||
| ``` | ||
| _Typescript:_ | ||
| ```ts | ||
| import FsGzipBlobStorage from "fs-gzip-blob-storage" | ||
| // or | ||
| import {FsGzipBlobStorage} from "fs-gzip-blob-storage" | ||
| ``` | ||
@@ -93,11 +89,11 @@ | ||
| - `ext` is a default extension added to file name for the object (optional, | ||
| default: `this.ext`) | ||
| - `part` is a extension added to file name which can be later commited | ||
| - `ext` is a default extension added to the file name for the object | ||
| (optional, default: `this.ext`) | ||
| - `part` is a extension added to the file name which can be later committed | ||
| (optional, default: `this.part`) | ||
| Creates a writable stream for a new object in the storage. Object is gzipped and | ||
| stored with the file name based on `key` and `ext` and `gzipExt` and `part`. | ||
| Throws an error if has occurred and if the file already exists for exclusive | ||
| mode. | ||
| Creates a writable stream for a new object in the storage. The object is | ||
| gzipped and stored with the file name based on `key` and `ext` and `gzipExt` | ||
| and `part`. Throws an error if has occurred and if the file already exists | ||
| for exclusive mode. | ||
@@ -112,7 +108,8 @@ ### createReadStream | ||
| - `ext` is a default extension added to file name for the object (optional, | ||
| default: `this.ext`) | ||
| - `ext` is a default extension added to the file name for the object | ||
| (optional, default: `this.ext`) | ||
| Creates a readable stream for an existing, gunzipped object in the storage. | ||
| Throws an error if has occurred or the object doesn't exist or its size is zero. | ||
| Throws an error if has occurred or if the object doesn't exist or its size is | ||
| zero. | ||
@@ -127,10 +124,10 @@ ### commit | ||
| - `ext` is a default extension added to file name for the object (optional, | ||
| default: `this.ext`) | ||
| - `part` is a extension added to file name which can be later commited | ||
| - `ext` is a default extension added to the file name for the object | ||
| (optional, default: `this.ext`) | ||
| - `part` is a extension added to the file name which can be later committed | ||
| (optional, default: `this.part`) | ||
| Commits the object in the storage. It means that file name for the object is | ||
| renamed and the additional extension for partial objects is removed. Throws an | ||
| error if has occurred or the object doesn't exist. | ||
| Commits the object in the storage. It means that the file name for the object | ||
| is renamed and the additional extension for partial objects is removed. | ||
| Throws an error if has occurred or the object doesn't exist. | ||
@@ -145,4 +142,4 @@ ### remove | ||
| - `ext` is a default extension added to file name for the object (optional, | ||
| default: `this.ext`) | ||
| - `ext` is a default extension added to the file name for the object | ||
| (optional, default: `this.ext`) | ||
@@ -154,4 +151,4 @@ Removes the object from the storage. Throws an error if has occurred or the | ||
| Copyright (c) 2018-2020 Piotr Roszatycki <piotr.roszatycki@gmail.com> | ||
| Copyright (c) 2018-2024 Piotr Roszatycki <piotr.roszatycki@gmail.com> | ||
| [MIT](https://opensource.org/licenses/MIT) |
| /// <reference types="node" /> | ||
| import {Readable, Writable} from "stream" | ||
| import zlib from "zlib" | ||
| import {Readable, Writable} from "node:stream" | ||
| import zlib from "node:zlib" | ||
@@ -6,0 +6,0 @@ import Pumpify from "pumpify" |
+5
-7
| { | ||
| "extends": "@tsconfig/node16/tsconfig.json", | ||
| "compilerOptions": { | ||
| "declaration": true, | ||
| "esModuleInterop": true, | ||
| "importHelpers": true, | ||
| "lib": ["es2018"], | ||
| "module": "commonjs", | ||
| "noImplicitAny": true, | ||
@@ -13,8 +11,8 @@ "noImplicitReturns": true, | ||
| "outDir": "./lib", | ||
| "sourceMap": true, | ||
| "strict": true, | ||
| "target": "es2018", | ||
| "typeRoots": ["node_modules/@types"] | ||
| }, | ||
| "exclude": ["./examples/**/*", "./lib/**/*", "./test/**/*"] | ||
| "exclude": ["./examples/**/*", "./lib/**/*", "./test/**/*"], | ||
| "ts-node": { | ||
| "transpileOnly": true | ||
| } | ||
| } |
-79
| # Changelog | ||
| ## v3.0.1 2020-10-08 | ||
| - Updated dependencies for `@types/node` to v14. | ||
| ## v3.0.0 2020-10-07 | ||
| - `DEFAULT_EXT`, `DEFAULT_PART` and `DEFAULT_GZIP_EXT` are constant strings. | ||
| - Requires Node >= 10. | ||
| - Converted from tslint to eslint. | ||
| ## v2.1.3 2019-10-07 | ||
| - Use `mocha-steps` for testing. | ||
| ## v2.1.2 2019-07-15 | ||
| - Updated dependencies. | ||
| ## v2.1.1 2019-06-04 | ||
| - Minor tweaks in README. | ||
| - Added source map to the package. | ||
| ## v2.1.0 2019-05-15 | ||
| - Uses `fs-blob-storage@2.1.0`. | ||
| ## v2.0.2 2019-05-08 | ||
| - Fix for dependencies. | ||
| ## v2.0.1 2019-05-08 | ||
| - Fix for README. | ||
| ## v2.0.0 2019-05-08 | ||
| - Breaking change: dropped support for Node 8. | ||
| ## v1.0.0 2018-09-07 | ||
| - Rewritten in Typescript. | ||
| - New syntax of import in plain Javascript. | ||
| ## v0.4.0 2018-07-16 | ||
| - New option `fs` with File System module. | ||
| - Tests don't use `mock-fs` package anymore. | ||
| - Tweaked jsdoc. | ||
| - Pack only important files. | ||
| ## v0.3.2 2018-05-24 | ||
| - Uses `stream.pipeline-shim` package in examples. Thank you, "npm, inc", for | ||
| making my life harder :-/ | ||
| ## v0.3.1 2018-05-24 | ||
| - Upgrade fs-blob-storage to v0.5.1: make storage compatible with Windows. | ||
| ## v0.3.0 2018-05-19 | ||
| - New constructor option `defaultExt` and `defaultPart`. | ||
| - Typescript: return `Promise<Readable>` and `Promise<Writable>` instead | ||
| `Promise<Pumpify>`. | ||
| ## v0.2.1 2018-05-19 | ||
| - Fixes jsdoc types. | ||
| ## v0.2.0 2018-05-18 | ||
| - Uses `stream.pipeline` shim instead `pump` in example scripts. | ||
| ## v0.1.0 2018-05-12 | ||
| - Initial release |
-1
| module.exports = require("./lib/fs-gzip-blob-storage") |
| {"version":3,"file":"fs-gzip-blob-storage.js","sourceRoot":"","sources":["../src/fs-gzip-blob-storage.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;;AAG9B,wDAAuB;AAEvB,8DAA6B;AAE7B,qDAQwB;AAkBxB,mDAAyD;AAAjD,8GAAA,WAAW,OAAA;AAAE,+GAAA,YAAY,OAAA;AAEpB,QAAA,gBAAgB,GAAG,KAAK,CAAA;AAErC,MAAa,iBAAiB;IAM5B,YAAY,UAAoC,EAAE;QAChD,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAa,CAAC,OAAO,CAAC,CAAA;QACzC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,6BAAW,CAAA;QAChE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAgB,CAAA;QACjF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,CAAA;IAC9C,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,GAAW,EAAE,UAA+C,EAAE;QACpF,MAAM,EAAC,GAAG,GAAG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AO,CAAA;QAEvB,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,EAAC,GAAG,EAAE,GAAG,GAAG,EAAE,EAAC,CAAC,CAAA;QAE9D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,UAA0C,EAAE;QAC9D,MAAM,EAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAC,GAAG,OAAO,CAAA;QAChC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAEvB,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,EAAC,GAAG,EAAE,GAAG,GAAG,EAAE,EAAC,CAAC,CAAA;QAE9D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;IAC7C,CAAC;CACF;AArDD,8CAqDC;AAED,kBAAe,iBAAiB,CAAA"} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
-33.33%Yes
NaN14939
-22.88%33
13.79%7
-30%159
-6.47%147
-2%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated