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

spotlight

Package Overview
Dependencies
Maintainers
1
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.

  • 0.1.337
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Spotlight.js

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: /docs/README.md

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

Installation and usage

In a browser:

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

Via npm:

npm install spotlight

In Narwhal, Node.js, and RingoJS:

var spotlight = require('spotlight');

In Rhino:

load('spotlight.js');

In RequireJS:

require(['path/to/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; });

Cloning this repo

To clone this repository including all submodules, using git 1.6.5 or later:

git clone --recursive https://github.com/bestiejs/spotlight.js.git
cd spotlight.js

For older git versions, just use:

git clone https://github.com/bestiejs/spotlight.js.git
cd spotlight.js
git submodule update --init

Feel free to fork if you see possible improvements!

Footnotes

  1. Spotlight.js has been tested in at least Chrome 5/8/12/14, Firefox 1.5-4, IE 6-10, Opera 9.25-12, Safari 2-5, Node.js 0.4.2, Narwhal 0.3.2, Ringo 0.7, and Rhino 1.7RC3.

Authors

Keywords

FAQs

Package last updated on 10 Aug 2011

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