Socket
Socket
Sign inDemoInstall

proto-list

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

proto-list

A utility for managing a prototype chain


Version published
Maintainers
1
Weekly downloads
7,604,801
decreased by-7.8%

Weekly downloads

Package description

What is proto-list?

The proto-list package is a simple data structure that manages a list of objects, each of which inherits from the one before it. This is useful for managing a chain of configurations or settings where each level of the list can override properties from the previous one.

What are proto-list's main functionalities?

Create and manage a prototypal list

This feature allows you to create a new prototypal list and manage it by pushing objects onto the list. Each object in the list inherits properties from the previous one.

{"var ProtoList = require('proto-list');\nvar list = new ProtoList();\nlist.push({a: 1});\nlist.push({b: 2});\nconsole.log(list.length); // 2\nconsole.log(list.a); // 1\nconsole.log(list.b); // 2"}

Access inherited properties

This feature demonstrates how properties in the list can be overridden by objects further down the list. The last object's properties take precedence.

{"var ProtoList = require('proto-list');\nvar list = new ProtoList();\nlist.push({a: 1});\nlist.push({b: 2});\nlist.push({a: 'overridden'});\nconsole.log(list.a); // 'overridden'\nconsole.log(list.b); // 2"}

Other packages similar to proto-list

Readme

Source

A list of objects, bound by their prototype chain.

Used in npm's config stuff.

FAQs

Last updated on 21 May 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc