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

piece_chain

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

piece_chain

a javascript implementation of the piece chain

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

piece_chain

A javascript implementation of a piece chain.

A piece chain is a way of structuring long strings in a linked list it offers masive improvements over normal text handling in javascript.

A good resource on piece chains is available here: http://www.catch22.net/tuts/piece-chains

Benchmarks show a 10x speed improvement over javascript strings.

1,000 inserts on a 1,000,000 character string was 70ms for PieceChain vs 744ms for Javascript Strings.

1,000 inserts on a 10,000,000 character string was 726ms for PieceChain vs 6585ms for Javascript Strings.

The other benefit of a piece chain is that it offers undo support virtually free.

ToDo:

  • Deletions are having issues.
  • Add undo support.
  • Add replace (which is simply a deletion followed by an insert).
  • Streams.

##Install:

npm install piece_chain

##How To:

var PC = require('piece_chain');
var pc = new PC( A_VERY_LONG_STRING );
pc.insert( offset, ANOTHER_STRING );
pc.del( offset , length );
pc.toString();

FAQs

Package last updated on 12 May 2016

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