Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 19, 2024 via pnpm

delegates 1.0.0

delegate methods and accessors to another property
Package summary
Share
0
issues
1
license
1
MIT
Package created
13 Jan 2014
Version published
14 Dec 2015
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
delegates@1.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of delegates 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does delegates do?

The "delegates" is a Node method and accessor delegation utility JavaScript package. This npm package allows you to delegate methods and accessors to another property. Delegating parts of behavior to another object is highly useful for maintaining code consistency, reducing redundancy, and enabling better control over levels of abstraction.

How do you use delegates?

To use "delegates", you would first need to install it using npm through the command npm install delegates. Once the package is installed, you can require it with var delegate = require('delegates');. The basic syntax for using this package includes calling delegate(), passing in the object, and the property to which you want to delegate methods and/or accessors. You then chain .method(), .getter(), .setter(), .access(), and /.fluent()` calls, passing in the names of the methods or accessors you want to delegate.

Here's an example of how you might use it:

var delegate = require('delegates');

delegate(proto, 'request')
  .method('acceptsLanguages')
  .method('acceptsEncodings')
  .method('acceptsCharsets')
  .method('accepts')
  .method('is')
  .access('querystring')
  .access('idempotent')
  .access('socket')
  .access('length')
  .access('query')
  .access('search')
  .access('status')
  .access('method')
  .access('path')
  .access('body')
  .access('host')
  .access('url')
  .getter('subdomains')
  .getter('protocol')
  .getter('header')
  .getter('stale')
  .getter('fresh')
  .getter('secure')
  .getter('ips')
  .getter('ip');

In this code, we're delegating several methods and accessors from some proto object to its request property.

Where are the delegates docs?

The documentation for "delegates" is set within the readme file from the GitHub repository. This documentation can be accessed on the project page at git+https://github.com/visionmedia/node-delegates.git. The docs specify how to install and use the package, showing how its methods can be invoked and chained to delegate behavior. They also provide an example use case for the package which can give you some ideas on how to get started with 'delegates.