Skip to content

grrrwaaa/mmapfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mmapfile

Node.js addon to map files as shared memory buffers, for unix + windows.

Using mmap is fast and allows shared memory between processes.

Usage:

const mf = require('mmapfile');

// open a file for read/write & map to a Buffer
let wb = mf.openSync("buf.txt", 8, "r+");		
// write to it:
wb.fill('-');

// open the file for read only & map to a Buffer
// (could be in an entirely different process)
let rb = mf.openSync("buf.txt", 8);
console.log(rb.byteLength); // 8
console.log(rb.toString('ascii')); // "--------" 

About

Node.js addon to map files as shared memory buffers, for unix + windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published