6.2.1 • Published 1 year ago

random-access-memory v6.2.1

Weekly downloads
1,454
License
MIT
Repository
github
Last release
1 year ago

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

Usage

const RAM = require('random-access-memory')
const file = new 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:

const file = new RAM(Buffer.from('hello world'))

If you want to mimick a folder on disk, you can use const createRAM = RAM.reusable().

This stores the created ram instances, ie ram = createRAM(name) in a map so they can be reopened with the same state, similar to working with files, but still backed by ram.

License

MIT

@dxos/feed-replication-network@dxos/data-cli@telios/telios-sdk@infinitebrahmanuniverse/nolb-random-a@everything-registry/sub-chunk-2525swarmpipethine-corevitra@coboxcoop/kappa-drive@coboxcoop/key-exchange@coboxcoop/multifeed@coboxcoop/peer-fs@rubenrodriguez/mixmap-peermapsjec-serverjec-http-serverjec-jaskkappa-chat-svelte-componentkappa-drivekappa-record-dbkappa-scopespearblockstree-tagged-hyperdrive@arsonar/core@atek-cloud/atek@backbonedao/core@chromatic-systems/rho@benwiley4000/fair-analytics@ddatabase/multi-keyy-datwebpack-dat@dxos/cli-data@frando/corestore-multifeed@fpapado/fair-analytics@geut/hyper-hooks@lejeunerenard/kappa-core-event-bus@dxos/random-access-storage@dxos/random-access-multi-storage@jimpick/dat-geoip@jimpick/dat-log@jimpick/dat-node@jimpick/dat-node-hyperdb-only@hypercortex/hypertask@hypercortex/hyperbuddy@hypercortex/hypercortex-object@dxos/cli-party@pqmcgill/dat-js@pqmcgill/dat-js-hyperdb@pqmcgill/dat-node@sammacbeth/dat-api-core@sammacbeth/dat-archive-web@sammacbeth/discovery-swarm-test@p2pcommons/sdk-js@pepa65/datcp@sogouda/portal@seandawson/hypermergemultifeedmetadb-coremixmap-peermapsmicroledgernative-messaging-swarmosm-p2p-memonline-nodus-interfaceonline-interfaceoni-platformonnipearstreampear-radioosm-ttysecret-handshake-over-hypercoreronin-p2preal-value-langrehosternetwork-mapnodus-frarmeworknodus-online-interfacepipette-hugo-workerredux-p2prandom-access-http-serverrandom-access-storage-fromrandom-access-webrebelwire-clientredilocalslashtags-sdksn_programming_testsharefgitpearhyperconsolehypercore-upload-serverhypercore-indexed-filehypercore-multi-keyhypercore-pipehyper-sdkhyperbeathyperbrowsehypermultifeedhypermushhypermounthyperns-servicehyperdrive-clihyperdrive-daemon
6.2.1

1 year ago

6.2.0

2 years ago

6.1.0

3 years ago

5.0.1

3 years ago

6.0.0

3 years ago

5.0.0

3 years ago

4.1.0

3 years ago

4.0.1

3 years ago

3.1.4

4 years ago

4.0.0

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.4.0

8 years ago

2.3.0

8 years ago

2.2.0

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago