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

backbone.namedconstructor

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone.namedconstructor

Names Backbone object constructors.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
Maintainers
1
Weekly downloads
 
Created
Source

backbone.namedconstructor

Build Status NPM version

Give your Backbone object a named constructor, so you can make sense of it in the dev tools console.

Works with AMD, CommonJS and browser globals.

Installation

$ npm install backbone.namedconstructor

Example

If you set a constructorName property, this will be used to name the constructor:

var Backbone = require('backbone');
require('backbone.namedconstructor');

var Model = Backbone.Model.extend({ constructorName: 'Foo' });
console.log(new Model().constructor.name);
// 'Foo'

So, instead of:

You'll see:

Tests

$ npm test

Credit

The basis for this module was this great Stack Overflow answer given by Dan Malcolm. Cheers!

License

MIT

Keywords

FAQs

Package last updated on 24 Aug 2015

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