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

asset-wrap

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asset-wrap - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

13

CHANGELOG.md

@@ -1,3 +0,14 @@

**v0.2.0** (2013-01-18)
**v0.2.2** (in progress)
*
**v0.2.1** (2013-02-11)
* ignoreErrors param to wrap.Assets
* fix merge for javascript files that are missing semicolons
* add custom Cache-Control setting to middleware
* add default config values for Assets
**v0.2.0** (2013-01-18 1:00pm EST)
* Breaking changes to shortcuts

@@ -4,0 +15,0 @@ * Add error handling

2

package.json
{
"name": "asset-wrap",
"description": "Asset management framework for nodejs",
"version": "0.2.0",
"version": "0.2.1",
"author": "Bryant Williams <b.n.williams@gmail.com>",

@@ -6,0 +6,0 @@ "repository": {"type": "git", "url": "git://github.com/scien/asset-wrap.git"},

@@ -25,4 +25,4 @@ Asset-Wrap is a simple asset manager for node.

Most of the time you'll always want to include the `dst` parameter. It defaults to `src` if not provided
* `dst`: the location to serve your file from (with md5 appended). also the cache key
Most of the time you'll always want to include the `dst` parameter. defaults to `src` if not provided
* `dst`: the location to serve your file from (without the md5 appended yet)

@@ -44,3 +44,3 @@ After "wrapping" your asset, it will contain

require('zappajs') ->
wrap = require '../lib/index'
wrap = require 'asset-wrap'
assets = new wrap.Assets [

@@ -57,38 +57,39 @@ new wrap.Snockets {

}
]
@use assets.middleware
], (err) =>
throw err if err
@use assets.middleware
@get '/': ->
@render index: {
assets: assets
}
@get '/': ->
@render index: {
assets: assets
}
@view index: ->
head ->
text @assets.tag '/css/hello.css'
text @assets.tag '/js/hello.js'
body ->
a href: @assets.url '/css/hello.css', ->
'View CSS'
pre ->
@assets.data '/css/hello.css'
a href: @assets.url '/js/hello.js', ->
'View Javascript'
pre ->
@assets.data '/js/hello.js'
@view index: ->
head ->
text @assets.tag '/css/hello.css'
text @assets.tag '/js/hello.js'
body ->
a href: @assets.url '/css/hello.css', ->
'View CSS'
pre ->
@assets.data '/css/hello.css'
a href: @assets.url '/js/hello.js', ->
'View Javascript'
pre ->
@assets.data '/js/hello.js'
```
### Generate Asset Dynamically
### Generate Asset Dynamically in ZappaJS
```
require('zappajs') ->
wrap = require '../lib/index'
wrap = require 'asset-wrap'
@get '/': ->
new wrap.Snockets {
asset = new wrap.Snockets {
src: 'assets/hello.coffee'
dst: '/js/hello.js'
compress: true
}, (asset) =>
@response.setHeader 'ContentType', asset.type
@response.send asset.data
}, (err) =>
@res.send 500, err if err
@res.setHeader 'ContentType', asset.type
@res.send asset.data
```

@@ -109,12 +110,13 @@

require('zappajs') ->
wrap = require '../lib/index'
wrap = require 'asset-wrap'
@get '/js/hello.js': ->
new wrap.Snockets {
asset = new wrap.Snockets {
src: 'assets/hello.coffee'
dst: '/js/hello.js'
compress: true
}, (asset) =>
@response.setHeader 'ContentType', asset.type
@response.send asset.data
}, (err) =>
@res.send 500, err if err
@res.setHeader 'ContentType', asset.type
@res.send asset.data

@@ -121,0 +123,0 @@ @get '/': ->

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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