npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jyql

v0.0.1

Published

Jyql is a browser-based and Node.js JavaScript library for fetching data from any Internet source using the Yahoo! Query Language engine (YQL) as a proxy.

Downloads

3

Readme

jyql

Jyql is a browser-based and Node.js JavaScript library for fetching data from any Internet source using the Yahoo! Query Language engine (YQL) as a proxy.

The real value added of jyql comes from using it within the browser, as using jyql allows you to override the cross-scripting limitations that most mainstream web browsers implements for security reasons, without making your web page less secure though.

It is just for consistency across browser and server code that jyql is designed to be used also on the server as a Node.js module. Node.js, though, has plenty of alternative ways to achieve the same results without the need of using YQL.

Jyql would not exist without Yahoo!, so be grateful to them and carefully read their terms of service and use referenced further down in this document.

Powered by Yahoo!

Why jyql

Today web browsers are powerful enough and suitable to fetch and transform data that is available from the Internet, to then assemble it together and present it to the user. Traditionally this role is performed on the server, where computational power was less of an issue and the security of what content was fetched could be better controlled.

Security is also the reason why the JavaScript implementation of most web browsers won't allow client-side code to fetch data from websites that are different from the one the current web page is served from (e.g. read about cross-site request forgery here). This is a strong although due limitation for developers, that penalises in particular the ones who are short on resources and cannot afford pushing to the server the same functionality.

The Yahoo! Query Language engine solves a great part of this problem. It takes the task of transforming the data one wants into a JSONP script she can then import into her web page. Script imports are the only data retrieval operations that are allowed cross-site, hence overriding the limitation described above. Read more about JSONP (here)[http://en.wikipedia.org/wiki/JSONP].

Jyql is a wrapper around Yahoo! Query Language, allowing you rely on the power of their services in a few lines of client-side JavaScript code. It can be as simple as in the example below, that displays on the web browser's JavaScript console the JSON output of a query:

<script src="dist/jyql-min.js"></script>
<script>
  // Get the estimated arrival times of live trains from Berkhamsted to Euston
  var q = "select * from html where url='http://ojp.nationalrail.co.uk/service/ldbboard/dep/EUS/BKM/To' and xpath='//div[@class=\"tbl-cont\"]/table/tbody/tr'";
  jyql(q, function (err, data) { console.log(data); });
</script>

#Requirements

In the browser

None!

In Node.js

The beautifully simple mikeal / request.

For developers

The source of jyql and all of its examples and test scripts are written in CoffeeScript that is always compiled before being used in tests or examples.

Jyql test scripts rely on the QUnit framework and, for the time being, cover the web browser-based functionality of the library only.

Grunt is used for packaging for distribution.

#Licensing

##Yahoo! Query Language Terms Of Use By using jyql you are also accepting both Yahoo! terms of service at http://info.yahoo.com/legal/us/yahoo/utos/utos-173.html and Yahoo! Query Language's terms of use at http://info.yahoo.com/legal/us/yahoo/yql/yql-4307.html.

##MIT license Copyright (c) 2012 Gianfranco Cecconi.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.