New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

goodeggs-assets

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goodeggs-assets

Shared runtime code to manage assets

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
2
Weekly downloads
 
Created
Source

goodeggs-assets

Shared runtime code to manage assets

build status npm version MIT license we're hiring

Usage

npm install --save goodeggs-assets
var goodeggsAssets = require('goodeggs-assets');
var express = require('express');
var app = express();
app.use(goodeggsAssets.middleware());

When NODE_ENV is production:

  • static assets will be served from build/public
  • assets will include far-future headers
  • goodeggsAssets.assetPath will translate paths using the manifest at build/rev-manifest.json

For other values of NODE_ENV:

  • static assets will be served from public
  • goodeggsAsets.assetPath will simply echo back the requested path

The paths above are all configurable using your Assetfile. See goodeggs-assets-cli for more information on the Assetfile.

View Helper

res.locals.assetPath will be set by the middleware, so if you're using an Express rendering engine, you can put calls like this.assetPath('/img/foo.jpg') in your templates, and they'll be translated to versioned URLs in production.

Contributing

Please follow our Code of Conduct when contributing to this project.

$ git clone https://github.com/goodeggs/goodeggs-assets && cd goodeggs-assets
$ npm install
$ npm test

Module scaffold generated by generator-goodeggs-npm.

FAQs

Package last updated on 03 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc