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

glob-brunch

v0.0.1-e

Published

Adds glob support to Brunch.

Downloads

33

Readme

glob-brunch Circle CI

Adds glob support to Brunch. This allows lazy loading/requiring of files using pattern matching. It stores the required filenames within your app.js file using a helper function and therefore cannot be used as a file system browser or such.

Please note that this is a very early alpha of this module and its usage is pretty restrictive. Please read the usage for caveats.

Usage

Add "glob-brunch": "0.0.1" to package.json in your brunch app.

In your code, use glob('[string]') and this plugin will automatically generate a helper function at the top of the module definition. For example:


# @file application.coffee

class App extends Application

  constructor: () ->
    glob 'views/**/*-view*', (err, files) ->
      console.log files # Should return an array of matching filenames.
      files.forEach (file) ->
        view = require file

This will generate a function on Brunch compilation and prepend it to the file. This function matches the glob definitions and the resolved matches. This means that the glob function MUST use a string as the Node/Brunch side will not evaluate your client-side javascript and thus has no knowledge of scope, variables etc. Hopefully this is something that can get ironed out; but please file an issue or PR if you can think of an obvious solution.

The function will look something like this:

var glob = function (input, callback) {
  switch (input) {
    case 'views/**/*-view*':
      return callback(null, ['views/components/Notification-view', 'views/layouts/HeaderLayout-view']);
  }
}

Config

As of the current version, glob-brunch has three config options:

exports.config =
  ...
  plugins:
    glob:
      appDir: 'app'
      stripExt: true
      stripAppDir: true

License

The MIT License (MIT)

Copyright (c) 2015 Matt Fletcher (http://soniflow.com)

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.