Giter Club home page Giter Club logo

jsapi-info's Introduction

JSAPI.info

A JS library source inspector. Libraries are specified in libs.json, e.g.

{
	"jquery": {
		"url": "https://ajax.googleapis.com/ajax/libs/jquery/{VERSION}/jquery.js",
		"default_version": "1.6.4",
		"versions": ["1", "1.1", "1.2", "1.3", "1.3.2", "1.4", "1.5", "1.6", "1.6.2", "1.6.4"],
		"get_real_version": "v(\\d+\\.\\d+\\.\\d+)",
		"look_in": ["jQuery.fn", "jQuery"],
		"mutate_names": [
			["^\\$(?=\\.)", "jQuery"],
			["^jQuery\\.prototype", "jQuery.fn"]
		]
	} // ,...
}

Given the above configuration, we can now access /jquery/[VERSION/]METHOD_NAME in our browser. JSAPI.info will only source the jQuery source file remotely (from googleapis) if it hasn't already cached it locally.

THIS IS STILL UNDER DEVELOPMENT: Live @ jsapi.info.

How does it work?

It works by loading the library you specify into an instance of jsdom, and then evaluating the method you specify (in fully qualified form, e.g. jQuery.fn.css) within that instance. It then matches the toString() representation of that function (thanks V8!!) against the source of the library, thus determining its location. It's all operating under node.js, running via a beautiful configuration of nginx (primed to microcache!) on a linode box somewhere in London.

jsapi-info's People

Contributors

mathiasbynens avatar padolsey avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.