New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ext2fs

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ext2fs - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1-node-12-64007eacee103838fdc90b52886301cb6d55e228

5

CHANGELOG.md

@@ -7,2 +7,7 @@ # Change Log

# v4.0.1
## (2022-07-17)
* support node 12 [Zane Hitchcox]
# v4.0.0

@@ -9,0 +14,0 @@ ## (2022-07-17)

19

lib/fs.js

@@ -118,4 +118,7 @@ // Maintainers, keep in mind that ES1-style octal literals (`0666`) are not

if (typeof options === 'string') {
if (defaultOptions === undefined) {
defaultOptions = {}
}
options = {
...(defaultOptions ?? {}),
...defaultOptions,
encoding: options,

@@ -354,3 +357,3 @@ };

position = null,
} = offsetOrOptions ?? kEmptyObject);
} = offsetOrOptions);
}

@@ -369,3 +372,3 @@ if (typeof offsetOrOptions !== 'number')

const buffer = Buffer.from(String(stringOrBuffer));
const encoding = length ?? 'utf8';
const encoding = length !== undefined ? length : 'utf8';
position = offsetOrOptions;

@@ -382,3 +385,3 @@ return writeBuffer(fd, buffer, 0, buffer.byteLength, position)

function writeCb(fd, buffer, offset, length, position, cb) {
cb = cb ?? arguments[arguments.length - 1];
cb = cb !== undefined ? cb : arguments[arguments.length - 1];
// follow node fs api and don't return promises

@@ -766,6 +769,6 @@ ;(async () => {

this.path = path;
this.fd = options.fd ?? null;
this.flags = options.flags ?? 'r';
this.mode = options.mode ?? 0o666;
this.autoClose = options.autoClose ?? true;
this.fd = options.fd !== undefined ? options.fd : null;
this.flags = options.flags !== undefined ? options.flags : 'r';
this.mode = options.mode !== undefined ? options.mode : 0o666;
this.autoClose = options.autoClose !== undefined ? options.autoClose : true;
this.start = options.start;

@@ -772,0 +775,0 @@ this.bytesWritten = 0;

{
"name": "ext2fs",
"version": "4.0.0",
"version": "4.0.1-node-12-64007eacee103838fdc90b52886301cb6d55e228",
"description": "WASM bindings to libext2fs for cross-platform ext filesystem handling",

@@ -49,4 +49,4 @@ "author": "Petros Angelatos <petrosagg@balena.io>",

"versionist": {
"publishedAt": "2022-07-17T01:42:55.351Z"
"publishedAt": "2022-07-17T18:35:05.461Z"
}
}

@@ -31,10 +31,14 @@ node-ext2fs

To build `node-ext2fs` you need to have `make` and `emcc` from emscripten >= 2.0.7 available on your
environment.
Prerequisites:
Build `node-ext2fs` using `npm`:
* git
* make
* [`emcc` >= 2.0.7](https://emscripten.org/docs/getting_started/downloads.html)
``` bash
$ npm run build
```
git clone --recursive https://github.com/balena-io-modules/node-ext2fs # clone the repository
cd node-ext2fs
npm i
npm run build
```

@@ -60,20 +64,20 @@ Usage

async function main() {
const diskImage = '/some/disk.image';
const offset = 272629760; // offset of the ext partition you want to mount in that disk image
try {
await withOpenFile(diskImage, 'r', async (handle) => {
const disk = new FileDisk(handle);
await withMountedDisk(disk, offset, async (fs, fsPromises) => {
// List files
console.log('readdir', await fsPromises.readdir('/'));
await fs.trim();
// Show discarded regions
console.log('discarded', disk.getDiscardedChunks());
// Show ranges of useful data aligned to 1MiB
console.log('ranges', await disk.getRanges(1024 ** 2));
});
});
} catch (error) {
console.error(error);
}
const diskImage = '/some/disk.image';
const offset = 272629760; // offset of the ext partition you want to mount in that disk image
try {
await withOpenFile(diskImage, 'r', async (handle) => {
const disk = new FileDisk(handle);
await withMountedDisk(disk, offset, async (fs, fsPromises) => {
// List files
console.log('readdir', await fsPromises.readdir('/'));
await fs.trim();
// Show discarded regions
console.log('discarded', disk.getDiscardedChunks());
// Show ranges of useful data aligned to 1MiB
console.log('ranges', await disk.getRanges(1024 ** 2));
});
});
} catch (error) {
console.error(error);
}
}

@@ -80,0 +84,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc