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 🙏

© 2026 – Pkg Stats / Ryan Hefner

yql-node

v0.2.1

Published

A YQL helper module for easy queries against YQL API. Includes OAuth access as well for those who wish authenticated access.

Readme

yql-node

NPM

A small module providing utility methods for accessing YQL API. Provides optional OAuth access helper. Most other node modules for YQL failed for me on large query strings so this one uses POST method.

Modified to support returning json with a property called format, and a chainable constructor function.

It is also possible to set query parameters to utilize e.g. datatables.org. An example is provided below but you can also check their website for more information.

Installation

npm install yql-node --save

Usage


  //call public endpoints out of the box by simple require

  var yqlXML = require('yql-node'); //will return XML results
  var yql = require('yql-node').formatAsJSON(); //will return JSON results

  //or set the instance to use OAuth and non-public endpoint like this
  var yqlWithOAuthXML = require('yql-node').withOAuth('CONSUMER KEY','CONSUMER SECRET'); //returns XML
  var yqlWithOAuth = require('yql-node').formatAsJSON().withOAuth('CONSUMER KEY','CONSUMER SECRET'); //returns JSON

  var query = 'select * from html where url="http://example.com"; ';

  //these two calls will produce same results

  //response passed to your callback will a string containing the YQL query result
  //so you read data straight from it

  //returns JSON
  yql.execute(query, function(error,response){
    console.log("yql:");
    console.log(response);
  });

  //after calling formatAsXML() it will return XML
  yql.formatAsXML().execute(query, function(error,response){
    console.log("yql as XML:");
    console.log(response);
  });

  //returns XML
  yqlXML.execute(query, function(error,response){
    console.log("yqlXML:");
    console.log(response);
  });

  //you can set the format via a property
  yqlXML.format = 'json';
  //and now it will return JSON
  yqlXML.execute(query, function(error,response){
    console.log("yqlXML as json:");
    console.log(response);
  });

  //this will call the non-public endpoint
  yqlWithOAuth.execute(query, function(error,response){
    console.log("yqlOAuth:");
    console.log(response);
  });
  
  //before calling any of the above you can use the following
  //to enable usage of datatables.org
  yql.setQueryParameter({
    env: 'store://datatables.org/alltableswithkeys'
  });

Dependencies and credits

[needle] (https://www.npmjs.com/package/needle) [oauth] (https://www.npmjs.com/package/oauth)

Contributing

If you find yourself wishing for a feature it doesn't have - feel free to fork, add it and generate a pull request. All contributions welcome.

Licence

[MIT] (https://github.com/djordjelacmanovic/yql-node/blob/master/LICENSE)

Release History

  • 0.2.1 Ability to pass query parameter to utilize datatables.org
  • 0.2.0 Added ability to request json format of the response
  • 0.1.5 Bug fixes and example improvement
  • 0.1.0 Initial release