
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
mirrorview
Advanced tools
Template engine that works like PHP, to display data in HTML use <?js writeToDocument = 'Example' ?>
MirrorView is a Node.js module that allows you to execute JavaScript code embedded within an HTML string and replace the code with the output.
To install MirrorView, use npm:
npm install mirrorview
To use MirrorView in your Node.js program, require the module and call the executeJS
function:
const mirrorview = require('mirrorview');
let html = '<html><body><h1><?js "Hello, world!" ?></h1></body></html>';
let context = {};
html = mirrorview.executeJS(context, html);
The executeJS function takes two arguments: a context object and an HTML string. The context object can be used to provide variables or functions that the embedded JavaScript code can use. To output values in the HTML string you can use the echo function, it takes a string as a parameter.
For example, the following HTML string will output "2":
<html>
<body>
<h1><?js echo(1 + 1); ?></h1>
</body>
</html>
Here is another example of how you could use the executeJS function in a Node.js program:
const mirrorview = require('mirrorview');
let html = `
<html>
<body>
<h1><?js "Hello, world!" ?></h1>
<p><?js echo("Today is " + new Date().toLocaleDateString()); ?></p>
<ul>
<?js
for (let i = 1; i <= 5; i++) {
echo('<li>Item ' + i + '</li>');
}
?>
</ul>
</body>
</html>
`;
let context = {};
html = mirrorview.executeJS(context, html);
console.log(html);
This code will output the following HTML string:
<html>
<body>
<h1>Hello, world!</h1>
<p>Today is [current date]</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
</body>
</html>
There are a few limitations to be aware of when using MirrorView:
MirrorView is released under the GNU AGPL v3.0 license. See LICENSE for more information.
FAQs
Template engine that works like PHP, to display data in HTML use <?js writeToDocument = 'Example' ?>
The npm package mirrorview receives a total of 1 weekly downloads. As such, mirrorview popularity was classified as not popular.
We found that mirrorview demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.