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

spotlight

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spotlight

An object crawler/property search library that works on nearly all JavaScript platforms.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-14.29%
Maintainers
2
Weekly downloads
 
Created
Source

Spotlight.js v1.0.0

An object crawler/property search library that works on nearly all JavaScript platforms1.

BestieJS

Spotlight.js is part of the BestieJS "Best in Class" module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, and plenty of documentation.

Documentation

The documentation for Spotlight.js can be viewed here: /doc/README.md

For a list of upcoming features, check out our roadmap.

Installation and usage

Spotlight.js’ only hard dependency is Lo-Dash.

In a browser:

<script src="lodash.js"></script>
<script src="spotlight.js"></script>

Via npm:

npm install spotlight

In Node.js and RingoJS:

var spotlight = require('spotlight');

In Rhino:

load('spotlight.js');

In an AMD loader like RequireJS:

require({
  'paths': {
    'spotlight': 'path/to/spotlight',
    'lodash': 'path/to/lodash'
  }
},
['spotlight'], function(spotlight) {
  spotlight.byKind('constructor');
});

Usage example:

// find all "length" properties
spotlight.byName('length');

// or find all "map" properties on jQuery
spotlight.byName('map', { 'object': jQuery, 'path': '$' });

// or all properties with `jQuery` objects
spotlight.byKind(jQuery);

// or all properties with `RegExp` values
spotlight.byKind('RegExp');

// or all properties with `null` values
spotlight.byKind('null');

// or all properties with `undefined` values
spotlight.byKind('undefined');

// or all constructors
spotlight.byKind('constructor');

// or all properties with the value `0`
spotlight.byValue(0);

// or all properties containing "oo" in their name
spotlight.custom(function(value, key) { return key.indexOf('oo') > -1; });

// or all properties with falsey values
spotlight.custom(function(value) { return !value; });

Footnotes

  1. Spotlight.js has been tested in at least Chrome 33-34, Firefox 27-28, IE 6-11, Opera 19-20, Safari 5-7, Node.js 0.6.21~0.10.26, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, and Rhino 1.7RC5.

Author

twitter/jdalton
John-David Dalton

Contributors

twitter/demoneaux
Benjamin Tan

Keywords

FAQs

Package last updated on 28 Apr 2014

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