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

lazy-assets

v0.1.11

Published

An opinionated and simple build-system approach.

Downloads

337

Readme

lazy-assets

An opinionated and simple build-system approach.

Features:

  • JavaScript minification and optimization
  • CSS minification and optimization
  • Bower integration
  • Zero configuration

Requirements

npm install -g lazy-assets

Development server

On development mode, asset definitions are evaluated and dynamically converted to a valid HTML tag. They are compiled on-demand. No "watch" required.

lazy-assets examples/simple

Production

When compiling for production, all your javascripts and stylesheets are compressed into a single file.

lazy-assets {input_dir} {output_dir}

How to use

Wrap all your assets with <assets> tag, and define each dependency with <asset> tag.

To start the development server, run the following: (by default it binds on localhost:3000.)

lazy-assets examples/simple

Then define your dependencies:

<assets>
  <asset href="jquery" source="bower" />
  <asset href="bootstrap" source="bower" />
  <asset href="ractive" source="bower" />
  <asset href="parsleyjs" source="bower" main="dist/parsley.min.js" />
  <asset href="datejs" source="bower" main="build/date.js,build/date-pt-BR.js" />
  <asset href="app.js" compile="browserify" />
  <asset href="test.less" />
  <asset href="test.coffee" />
  <asset href="js/*.js" />
</assets>

When http://localhost:8000 is requested, the output of the HTML file will be the following:

<link href="dependencies/bootstrap/dist/css/bootstrap.css?533a476e18588" rel="stylesheet" media="all" type="text/css" />
<link href="test.less?533a476e18810" rel="stylesheet" media="all" type="text/css" />
<script type="text/javascript" src="dependencies/jquery/dist/jquery.js?533a476e184a3"></script>
<script type="text/javascript" src="dependencies/bootstrap/dist/js/bootstrap.js?533a476e1859a"></script>
<script type="text/javascript" src="dependencies/ractive/build/Ractive.js?533a476e186be"></script>
<script type="text/javascript" src="dependencies/parsleyjs/dist/parsley.min.js?533a476e18748"></script>
<script type="text/javascript" src="dependencies/datejs/build/date.js?533a476e187ba"></script>
<script type="text/javascript" src="dependencies/datejs/build/date-pt-BR.js?533a476e187d6"></script>
<script type="text/javascript" src="app.js?compile=browserify&533a476e187fa"></script>
<script type="text/javascript" src="test.coffee?533a476e18822"></script>
<script type="text/javascript" src="js/*.js?533a476e1883e"></script>

Now let's compile it for production:

lazy-assets examples/simple examples/simple-output

Result:

<script type="text/javascript" src="javascripts-533afd8c542fd.js"></script>
<link href="stylesheets-533afd8c.css" rel="stylesheet" media="all" type="text/css" />

License

MIT