diff --git a/README.md b/README.md index 2123e35d..e3685d7b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# BrowserFS v1.0.0 +# BrowserFS v1.1.0 > BrowserFS is an in-browser file system that emulates the [Node JS file system API](http://nodejs.org/api/fs.html) and supports storing and retrieving files from various backends. BrowserFS also integrates nicely into the Emscripten file system. [![Build Status](https://travis-ci.org/jvilk/BrowserFS.svg?branch=master)](https://travis-ci.org/jvilk/BrowserFS) @@ -19,6 +19,8 @@ BrowserFS is highly extensible, and ships with many filesystem backends: * Note: You provide this filesystem with an authenticated [DropboxJS client](https://github.com/dropbox/dropbox-js) * `InMemory`: Stores files in-memory. Thus, it is a temporary file store that clears when the user navigates away. * `ZipFS`: Read-only zip file-backed FS. Lazily decompresses files as you access them. + * Supports DEFLATE out-of-the-box. + * Have super old zip files? [The `browserfs-zipfs-extras` package](https://github.com/jvilk/browserfs-zipfs-extras) adds support for EXPLODE, UNREDUCE, and UNSHRINK. * `WorkerFS`: Lets you mount the BrowserFS file system configured in the main thread in a WebWorker, or the other way around! * `MountableFileSystem`: Lets you mount multiple file systems into a single directory hierarchy, as in *nix-based OSes. * `OverlayFS`: Mount a read-only file system as read-write by overlaying a writable file system on top of it. Like Docker's overlayfs, it will only write changed files to the writable file system. diff --git a/package.json b/package.json index 8155f6da..c8749a47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "browserfs", - "version": "1.0.0", + "version": "1.1.0", "description": "A filesystem in your browser!", "main": "dist/browserfs.js", "typings": "dist/browserfs", diff --git a/src/backend/ZipFS.ts b/src/backend/ZipFS.ts index 91879ed1..69f51f51 100644 --- a/src/backend/ZipFS.ts +++ b/src/backend/ZipFS.ts @@ -58,7 +58,7 @@ import {FileIndex, DirInode, FileInode, isDirInode, isFileInode} from '../generi /** * Maps CompressionMethod => function that decompresses. */ -const decompressionMethods: {[method: number]: (data: Buffer, compressedSize: number, uncompressedSize: number) => Buffer} = {}; +const decompressionMethods: {[method: number]: (data: Buffer, compressedSize: number, uncompressedSize: number, flags: number) => Buffer} = {}; /** * 4.4.2.2: Indicates the compatibiltiy of a file's external attributes. @@ -236,7 +236,7 @@ export class FileData { const compressionMethod: CompressionMethod = this.header.compressionMethod(); const fcn = decompressionMethods[compressionMethod]; if (fcn) { - return fcn(this.data, this.record.compressedSize(), this.record.uncompressedSize()); + return fcn(this.data, this.record.compressedSize(), this.record.uncompressedSize(), this.record.flag()); } else { let name: string = CompressionMethod[compressionMethod]; if (!name) { @@ -509,7 +509,7 @@ export default class ZipFS extends SynchronousFileSystem implements FileSystem { public static isAvailable(): boolean { return true; } - public static RegisterDecompressionMethod(m: CompressionMethod, fcn: (data: Buffer, compressedSize: number, uncompressedSize: number) => Buffer): void { + public static RegisterDecompressionMethod(m: CompressionMethod, fcn: (data: Buffer, compressedSize: number, uncompressedSize: number, flags: number) => Buffer): void { decompressionMethods[m] = fcn; } diff --git a/src/core/browserfs.ts b/src/core/browserfs.ts index 39da84d6..2b6b0c32 100644 --- a/src/core/browserfs.ts +++ b/src/core/browserfs.ts @@ -9,6 +9,7 @@ import {FileSystemConstructor, FileSystem} from './file_system'; import EmscriptenFS from '../generic/emscripten_fs'; import Backends from './backends'; import * as BFSUtils from './util'; +import * as Errors from './api_error'; if (( process)['initializeTTYs']) { ( process)['initializeTTYs'](); @@ -81,4 +82,4 @@ export function initialize(rootfs: FileSystem) { return fs.initialize(rootfs); } -export {EmscriptenFS, Backends as FileSystem}; +export {EmscriptenFS, Backends as FileSystem, Errors}; diff --git a/src/rollup.config.js b/src/rollup.config.js index a6babba9..42831833 100644 --- a/src/rollup.config.js +++ b/src/rollup.config.js @@ -25,9 +25,7 @@ export default { jsnext: true, preferBuiltins: true }), - sourcemaps({ - exclude: '**/*' - }), + sourcemaps(), buble() ] };