create a ram disk with node.js
var ramdisk = require('node-ramdisk')
return a ramdisk
object
var disk = ramdisk('my_ramdisk')
Note: delete will eject the volume and remove the mount folder
var ramdisk = require('node-ramdisk')
var disk = ramdisk('my_ramdisk')
var volumePoint
// create a disk with 100MB of size
disk.create(100, function (err, mount) {
if (err) {
console.log(err)
} else {
volumePoint = mount
console.log(mount)
}
})
// when isn't needed then delete the disk
disk.delete(volumePoint, function (err) {
if (err) {
console.log(err)
} else {
console.log('ok')
}
})
DEBUG=node-ramdisk ...
to run test
npm test
to run jshint
npm run jshint
to run code style
npm run code-style
to run check code coverage
npm run check-coverage
to open the code coverage report
npm run open-coverage