Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

memory-pager

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memory-pager

Access memory using small fixed sized buffers

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5M
increased by8.63%
Maintainers
1
Weekly downloads
 
Created

What is memory-pager?

The memory-pager package is a utility for managing and abstracting over pages of memory, allowing for efficient memory allocation and manipulation in a paged manner. It is particularly useful in scenarios where managing large datasets or buffers in a memory-efficient way is crucial, such as in databases or file systems.

What are memory-pager's main functionalities?

Page allocation and retrieval

This feature allows for the allocation and retrieval of memory pages. The code sample demonstrates how to allocate a new page (or retrieve it if it already exists) and then fill it with zeros.

const pager = require('memory-pager')();
let page = pager.get(0, true);
page.fill(0); // Allocate and fill the first page with zeros

Page updates and access

This feature enables updating and accessing data within a page. The code sample shows how to write data to a page and then read it back.

const data = Buffer.from('hello world');
page.set(data, 0); // Write data to the beginning of the page
const readData = page.get(0, data.length); // Read data from the page

Other packages similar to memory-pager

FAQs

Package last updated on 09 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc