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

gulp-yui-meta

v0.1.2

Published

Extract YUI Loader meta from YUI modules

Readme

Information

Basic Usage

Extract meta from build YUI modules and concat to string representation of a JavaScript object.

var yuiMeta = require("gulp-yui-meta");

gulp.task("templates", function () {
  return gulp.src("./lib/build/*/*-min.js")
    .pipe(yuiMeta("meta.js"))
    .pipe(gulp.dest("./lib/build/meta"));
});

Supported meta data

The supported parameters for the YUI module configuration can be found in the YUI Documentation.

Note This plugin accounts for functions inside the module configuration and keeps them executable in the outputted JavaScript Object. If you want to save the meta data as a .json file you have to parse them out before.

Example

The following example of a gulp task assumes you have your build modules in subfolders by module name in a ./public/build folder:

var yuiMeta = require("gulp-yui-meta"),
    wrap = require("gulp-wrap"),
    rename = require("gulp-rename"),
    uglify = require("gulp-uglify");

gulp.task("meta", function () {
    return gulp.src(["public/build/*/*.js", "public/build/*/*.css"])
        // Concat the YUI module meta
        .pipe(yuiMeta("meta.js"))
        // Wrap the plain JavaScript hash inside a template to be able to
        // include it as a script in the browser later on. You may change the
        // template if you want to use the meta data as an AMD or RequireJS
        // module instead.
        .pipe(wrap("YUI.namespace(\"Env\").modules = <%= contents %>;\n"))
        // Write the file to disk
        .pipe(gulp.dest("public/build/meta"))
        // Rename the file from `meta.js` to `meta-min.js`
        .pipe(rename({suffix: "-min"}))
        // Minify the meta file
        .pipe(uglify())
        // Write the minified file to disk
        .pipe(gulp.dest("public/build/meta"));
});

This task generates a meta folder inside your public/build folder, which will contain a raw (meta.js) and a minified (meta-min.js) version of your YUI module meta.

Now you can use the meta file in your HTML like this:

<html>
<head>
    ...
</head>
<body>
    ...
    <script src="http://yui.yahooapis.com/3.17.1/build/yui/yui-min.js"></script>
    <script src="/build/meta/meta-min.js"></script>
    <script>
        (function (window) {
            window.YUI_config || (window.YUI_config = {});
            window.YUI_config.groups || (window.YUI_config.groups = {});
            window.YUI_config.groups.myGroup = {
                filter: "min",
                base: "build/",
                comboBase: "combo?",
                root: "build/",
                modules: YUI.namespace("Env").modules
            };
        }(this));

        YUI().use("my-custom-module", function (Y) {
            "use strict";
            var myClass = new Y.MyCustomClass();
        });
    </script>
</body>
</html>

LICENSE

MIT License