New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jerrymander

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jerrymander

text-content addressing for the web

  • 0.4.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-46.67%
Maintainers
1
Weekly downloads
 
Created
Source

jerry

Pages on the web are modeled as data in the form of a tree. Nodes have child nodes, such that your average webpage consists of containers of containers of containers of--ultimately--text or media content. In certain contexts, notably from the perspective of a user, webpages are better represented with the flat structure of a more traditional document. Jerry is a framework for translating between webpages-as-tree-structures and -as-linear-text. With jerry, every Node on a webpage is given an Address---which can then be manipulated in various ways.

jerry

install

$ npm install jerrymander

usage

const jerry = new Jerry()
jerry.getSelection().highlight()
localStorage.highlights = JSON.stringify(jerry.serialize())

docs

  • new Jerry(root = document.body)

create a Jerry instance around a given root node.

  • Jerry#getSelection(): Address

get the address of the current user selection.

  • Address#highlight(className = 'highlight)

highlight the content at a given address (takes an optional className to apply).

  • Address#select()

set selected text range to the contents of this address

  • Jerry#serialize(): string[]

serializes all highlights for storage or transmission.

  • Jerry#deserialize(highlights: string[]): Address[]

deserialize a serialization result back into Addresses.

  • Address#getHash(): number

get the hash of the content at an address.

FAQs

Package last updated on 31 Jul 2023

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