@newkind/fs
Table of Contents
Getting Started
It is librari for easy to use test of mocha.js devTool eruda and events bus for uour projects
Install
Installing @newkind/fs
with npm
$ npm i @newkind/fs
Installing @newkind/fs
with yarn
$ yarn add @newkind/fs
Example
<script type="module">
import { IDBFS } from './modules/index.mjs'
(async ()=>{
await IDBFS()
})()
</script>
License
GNU GENERAL PUBLIC LICENSE version 3 by Zababurin Sergey converted to Markdown. Read the original GPL v3.
API
FS.read(stream, buffer, offset, length[, position])
Read length bytes from the stream, storing them into buffer starting at offset.
By default, reading starts from the stream’s current offset, however, a specific offset can be specified with the position argument. For example:
var stream = FS.open('abinaryfile', 'r');
var buf = new Uint8Array(4);
FS.read(stream, buf, 0, 4, 0);
FS.close(stream);
Arguments
stream (object) – The stream to read from.
buffer (ArrayBufferView) – The buffer to store the read data.
offset (int) – The offset within buffer to store the data.
length (int) – The length of data to write in buffer.
position (int) – The offset within the stream to read. By default this is the stream’s current offset.
FS.write(stream, buffer, offset, length[, position])
Writes length bytes from buffer, starting at offset.
By default, writing starts from the stream’s current offset, however, a specific offset can be specified with the position argument. For example:
var data = new Uint8Array(32);
var stream = FS.open('dummy', 'w+');
FS.write(stream, data, 0, data.length, 0);
FS.close(stream);
Arguments
stream (object) – The stream to write to.
buffer (ArrayBufferView) – The buffer to write.
offset (int) – The offset within buffer to write.
length (int) – The length of data to write.
position (int) – The offset within the stream to write. By default this is the stream’s current offset.
let blob = myFiles[0].slice(0, 10 * 1024 * 1024);