random-access-memory

WebJar for random-access-memory

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

random-access-memory
Last Version

Last Version

2.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

random-access-memory
WebJar for random-access-memory
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/random-access-storage/random-access-memory

Download random-access-memory

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/random-access-memory/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>random-access-memory</artifactId>
    <version>2.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/random-access-memory/
implementation 'org.webjars.npm:random-access-memory:2.4.0'
// https://jarcasting.com/artifacts/org.webjars.npm/random-access-memory/
implementation ("org.webjars.npm:random-access-memory:2.4.0")
'org.webjars.npm:random-access-memory:jar:2.4.0'
<dependency org="org.webjars.npm" name="random-access-memory" rev="2.4.0">
  <artifact name="random-access-memory" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='random-access-memory', version='2.4.0')
)
libraryDependencies += "org.webjars.npm" % "random-access-memory" % "2.4.0"
[org.webjars.npm/random-access-memory "2.4.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : process-nextick-args jar [1.0.7,2)

Project Modules

There are no modules declared in this project.

random-access-memory

Exposes the same interface as random-access-file but instead of writing/reading data to a file it maintains it in memory. This is useful when running tests where you don't want to write files to disk.

npm install random-access-memory

build status

Usage

var ram = require('random-access-memory')
var file = ram()

file.write(0, Buffer.from('hello'), function () {
  file.write(5, Buffer.from(' world'), function () {
    file.read(0, 11, console.log) // returns Buffer(hello world)
  })
})

You can also initialize a ram instance with a Buffer:

var file = ram(Buffer.from('hello world'))

License

MIT

org.webjars.npm
Random Access Storage projects and community

Versions

Version
2.4.0