Socket
Socket
Sign inDemoInstall

node-iframe

Package Overview
Dependencies
26
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

15

dist/cache/cache.js

@@ -9,8 +9,19 @@ "use strict";

var config_1 = require("@app/config");
var appCache = new node_cache_1["default"](config_1.cacheConfig);
function _extractValidNodeCacheOptions(options) {
return Object.keys(options).reduce(function (object, key) {
if (key !== "disabled") {
object[key] = options[key];
}
return object;
}, {});
}
var appCache = new node_cache_1["default"](_extractValidNodeCacheOptions(config_1.cacheConfig));
exports.appCache = appCache;
function configureCacheControl(options) {
appCache.options = Object.assign({}, appCache.options, options);
if ("disabled" in options) {
config_1.cacheConfig.disabled = options.disabled;
}
appCache.options = Object.assign({}, appCache.options, _extractValidNodeCacheOptions(options));
}
exports.configureCacheControl = configureCacheControl;
//# sourceMappingURL=cache.js.map

2

dist/config/cache.js

@@ -8,4 +8,4 @@ "use strict";

exports.checkperiod = checkperiod;
var cacheConfig = { stdTTL: stdTTL, checkperiod: checkperiod };
var cacheConfig = { stdTTL: stdTTL, checkperiod: checkperiod, disabled: false };
exports.cacheConfig = cacheConfig;
//# sourceMappingURL=cache.js.map

@@ -104,2 +104,3 @@ "use strict";

}
if (!!config_1.cacheConfig.disabled) return [3, 4];
_b.label = 1;

@@ -138,3 +139,3 @@ case 1:

}
cache_1.appCache.set(url, $html_1.html());
!config_1.cacheConfig.disabled && cache_1.appCache.set(url, $html_1.html());
}

@@ -141,0 +142,0 @@ if (server) {

{
"name": "node-iframe",
"version": "1.3.0",
"version": "1.3.1",
"description": "create a iframe on your server to bypass CORS issues. ( reverse engineer security issues )",

@@ -5,0 +5,0 @@ "main": "dist/iframe.js",

@@ -9,3 +9,3 @@ # node-iframe

`yarn install node-iframe`
`npm install node-iframe` or `yarn add node-iframe`

@@ -35,3 +35,3 @@ ## How to use

You can even fetch the iframe directly on the content if needed.
You can even fetch the iframe directly by importing fetchFrame on the client or server.

@@ -45,9 +45,8 @@ ```typescript

/* optional: configure cache-control - check https://github.com/node-cache/node-cache#options
* for more options and info
**/
configureCacheControl({ stdTTL: 0, checkperiod: 600 });
// optional: configure cache-control, to disable cache set `disabled` to true - check https://github.com/node-cache/node-cache#options
// for more options and info
configureCacheControl({ stdTTL: 0, checkperiod: 600, disabled: false });
// optional: configure error-pages - check src/templates for more info
// 0: error, 1: not-found, 2: all templates check src/templates/config for options
// 0: error, 1: not-found, 2: all templates - check src/templates/config for options
configureTemplates("<div>No Fish found</div>", 1);

@@ -62,4 +61,2 @@

Screenshot above is an example image of the package used at [A11ywatch](https://www.a11ywatch.com)
## Params

@@ -71,3 +68,3 @@

This project uses cheerio to manipulate dom contents very fast. If your iframe fails to render thats where the security issues need to be reverse hacked by us. As an alternative solution if the iframe fails to load simply fall back to the normal url of web page. You can fire this as an api request directly with `fetch` to get the website as html or use directly as your iframe src for best performance.
This project uses cheerio to manipulate html very fast. If your iframe fails to render thats where the security issues need to be reverse hacked by us using this project. As an alternative solution if the iframe fails to load simply fall back to the normal url of web page. You can fire this as an api request directly with `fetch` to get the website as html or use directly as your iframe src for best performance.

@@ -74,0 +71,0 @@ ## License

import NodeCache, { Options as CacheOptions } from "node-cache";
interface AppCache extends CacheOptions {
disabled: boolean;
}
declare const appCache: NodeCache;
declare function configureCacheControl(options: CacheOptions): void;
declare function configureCacheControl(options: AppCache): void;
export { appCache, configureCacheControl };

@@ -6,3 +6,4 @@ declare const stdTTL = 100;

checkperiod: number;
disabled: boolean;
};
export { stdTTL, checkperiod, cacheConfig };

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc