Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chrome-fs

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-fs - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

test/simple/test-fs-write-buffer.js

83

chrome.js
var util = require('util')
var Buffer = require('buffer').Buffer
var Stream = require('stream').Stream
var Readable = Stream.Readable

@@ -492,7 +493,10 @@ var Writable = Stream.Writable

var buf = new Buffer(buffer)
if (fd.readyState > 0) {
if (position !== null) {
window.setTimeout(delayedPositionWrite, 0, position, blob, callback, buf.length, fd)
} else {
window.setTimeout(delayedWrite, 0, blob, callback, buf.length, fd)
fd.onwriteend = function () {
if (position !== null) {
fd.seek(position)
}
fd.write(blob)
callback(null, buf.length)
}

@@ -504,17 +508,6 @@ } else {

fd.write(blob)
window.setTimeout(callback, 0, null, buf.length)
callback(null, buf.length)
}
}
function delayedPositionWrite (position, blob, cb, length, fd) {
fd.seek(position)
fd.write(blob)
cb(null, length)
}
function delayedWrite (blob, cb, length, fd) {
fd.write(blob)
cb(null, length)
}
exports.unlink = function (fd, callback) {

@@ -635,5 +628,5 @@ var path = resolve(fd)

exports.close = function (fd, callback) {
fd.onwriteend = function (info) {
fd.onwriteend = function (progressinfo) {
var cb = makeCallback(callback)
cb(null, info)
cb(null, progressinfo)
}

@@ -904,55 +897,1 @@ }

WriteStream.prototype.destroySoon = WriteStream.prototype.end
/*
fs.rename(oldPath, newPath, callback)
fs.ftruncate(fd, len, callback)
fs.truncate(path, len, callback)
fs.chown(path, uid, gid, callback)
fs.fchown(fd, uid, gid, callback)
fs.lchown(path, uid, gid, callback)
fs.chmod(path, mode, callback)
fs.fchmod(fd, mode, callback)
fs.lchmod(path, mode, callback)
fs.stat(path, callback)
fs.lstat(path, callback)
fs.fstat(fd, callback)
fs.link(srcpath, dstpath, callback)
fs.symlink(srcpath, dstpath[, type], callback)
fs.readlink(path, callback)
fs.realpath(path[, cache], callback)
fs.unlink(path, callback)
fs.rmdir(path, callback)
fs.mkdir(path[, mode], callback)
fs.readdir(path, callback)
fs.close(fd, callback)
fs.open(path, flags[, mode], callback)
fs.utimes(path, atime, mtime, callback)
fs.futimes(fd, atime, mtime, callback)
fs.fsync(fd, callback)
fs.write(fd, buffer, offset, length[, position], callback)
fs.write(fd, data[, position[, encoding]], callback)
fs.read(fd, buffer, offset, length, position, callback)
fs.readFile(filename[, options], callback)
fs.writeFile(filename, data[, options], callback)
fs.appendFile(filename, data[, options], callback)
fs.watchFile(filename[, options], listener)
fs.unwatchFile(filename[, listener])
fs.watch(filename[, options][, listener])
Caveats
Availability
Filename Argument
fs.exists(path, callback)
fs.access(path[, mode], callback)
Class: fs.Stats
Stat Time Values
fs.createReadStream(path[, options])
Class: fs.ReadStream
Event: 'open'
fs.createWriteStream(path[, options])
Class: fs.WriteStream
Event: 'open'
file.bytesWritten
Class: fs.FSWatcher
watcher.close()
Event: 'change'
Event: 'error'
*/
{
"name": "chrome-fs",
"version": "1.2.0",
"version": "1.2.1",
"description": "Use the Node `fs` API in Chrome Apps",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -1,10 +0,11 @@

var test_fs_stat = require('../simple/test-fs-stat') // eslint-disable-line
var test_fs_exists = require('../simple/test-fs-exists') // eslint-disable-line
var test_fs_write_file = require('../simple/test-fs-write-file') // eslint-disable-line
var test_fs_append_file = require('../simple/test-fs-append-file') // eslint-disable-line
var test_fs_mkdir = require('../simple/test-fs-mkdir') // eslint-disable-line
var test_readdir = require('../simple/test-fs-readdir') // eslint-disable-line
var test_fs_write = require('../simple/test-fs-write') // eslint-disable-line
require('../simple/test-fs-stat')
require('../simple/test-fs-exists')
require('../simple/test-fs-write-file')
require('../simple/test-fs-append-file')
require('../simple/test-fs-mkdir')
require('../simple/test-fs-readdir')
require('../simple/test-fs-write')
require('../simple/test-fs-write-buffer')
// var test_fs_empty_readStream = require('../simple/test-fs-empty-readStream') // eslint-disable-line
// var read_stream_fd_test = require('../simple/test-fs-read-stream-fd') // eslint-disable-line
// require('../simple/test-fs-empty-readStream')
// require('../simple/test-fs-read-stream-fd')

Sorry, the diff of this file is too big to display

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