Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodesi

Package Overview
Dependencies
Maintainers
3
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodesi - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

.nyc_output/348dc1d4-90a2-49a0-a799-a4298c19649f.json

8

lib/esi.js

@@ -26,2 +26,5 @@ 'use strict';

// in current module, esi:remove are simply removed
html = handleESIRemove(html);
let i = 0;

@@ -73,2 +76,7 @@ const tags = findESIIncludeTags(html, options);

function handleESIRemove(html) {
const re = /<esi:remove>([\s\S]*?)<\/esi:remove>/gm;
return html.replace(re, '');
}
function getIncludeContents(tag, options) {

@@ -75,0 +83,0 @@ const src = getDoubleQuotedSrc(tag) || getSingleQuotedSrc(tag) || getUnquotedSrc(tag);

8

package.json
{
"name": "nodesi",
"version": "1.11.0",
"version": "1.12.0",
"description": "ESI: the good parts in node.js",

@@ -9,3 +9,3 @@ "main": "esi.js",

"test:debug": "mocha --inspect-brk test/*.js",
"coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive --exit",
"coverage": "nyc npm run test",
"perf": "node perf.js"

@@ -25,4 +25,4 @@ },

"hjs": "0.0.6",
"istanbul": "0.4.5",
"mocha": "5.2.0"
"mocha": "5.2.0",
"nyc": "^14.1.1"
},

@@ -29,0 +29,0 @@ "keywords": [

@@ -29,3 +29,4 @@ [![Build Status](https://travis-ci.org/Schibsted-Tech-Polska/nodesi.svg?branch=master)](https://travis-ci.org/Schibsted-Tech-Polska/nodesi)

* Support for <esi:include> tags
* Support for `<esi:include>` tags
* support for `alt` as fallback URL
* Out of the box Express support

@@ -35,4 +36,17 @@ * Custom logging

...and more, take a look at test cases for complete list.
…and more, take a look at test cases for complete list.
### Advanced ESI features
`nodesi` does not support the entire ESI spec, but aims to provide a usable subset. This includes, of course `<esi:include src="…">`, but also some more advanced features like:
#### Fallback URL with `alt`
```html
<esi:include src="http://example.com/1.html" alt="http://bak.example.com/2.html"/>
```
Will try to include `http://example.com/1.html` first, and if that fails, fall back to `http://bak.example.com/2.html`. If both requests fail, the standard error handling described below will kick in.
## Installation

@@ -39,0 +53,0 @@

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