
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@lasso/marko-taglib
Advanced tools
The Lasso.js includes a taglib for Marko for easily injecting <script>
and <link>
tags into a page, as well as resource URLs for images and other types of front-end resources.
In order to automatically detect and compile required *.marko
templates we
will need to install the lasso-marko
plugin and lasso-marko-taglib
taglib using the following commands:
npm install lasso-marko
npm install @lasso/marko-taglib
<lasso-page name="my-page" package-path="./browser.json"/>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Page</title>
<lasso-head/>
</head>
<body>
<h1>Test Page</h1>
<lasso-body/>
</body>
</html>
Output HTML will be similar to the following:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Page</title>
<link rel="stylesheet" type="text/css" href="/static/my-page-85e3288e.css">
</head>
<body>
<h1>Test Page</h1>
<script type="text/javascript" src="/static/bundle1-6df28666.js"></script>
<script type="text/javascript" src="/static/bundle2-132d1091.js"></script>
<script type="text/javascript" src="/static/my-page-1de22b65.js"></script>
</body>
</html>
<lasso-page>
Lassoes the page so that the resulting JavaScript and CSS resources can be injected into the output HTML. The <lasso-head>
and <lasso-body>
tags are used as insertion points. By default, all CSS <link>
tags will be added to the <lasso-head>
slot and all <script>
tags will be added to the <lasso-body>
slot.
Supported attributes:
package-paths
, but an Array of paths.Lasso
instance. Defaults to the default page lasso (i.e. require('lasso').getDefaultLasso()
)lassoContext.data
object.Examples:
With a path to an browser.json
file:
<lasso-page package-path="./browser.json"/>
With an explicit page name flags:
<lasso-page name="home" package-path="./browser.json"/>
With enabled flags:
<lasso-page package-path="./browser.json" flags="['foo', 'bar']"/>
With dependencies:
<lasso-page dependencies="['foo.js', 'bar.css']"/>
<lasso-head>
The head slot that is used as the marker for inserting CSS <link>
tags in the head section of the HTML page.
<lasso-body>
The body slot that is used as the marker for inserting JavaScript <script>
tags in the body section of the HTML page.
<lasso-img>
Lassoes an image resource and renders an <img>
tag with the src
attribute set to the resulting URL of the bundled image resource.
Supported attributes:
<img>
tagExample:
<lasso-img src="./foo.png" width="32" height="32" class="foo">
The output will be similar to the following:
<img src="/static/foo-1b4c0db.png" width="32" height="32" class="foo">
<lasso-resource>
Lassoes an arbitrary resource and introduces a local variable that can be used to inject the resulting resource URL into the page.
Supported attributes:
Example:
<lasso-resource path="./favicon.ico" var="favicon"/>
<link rel="shortcut icon" href="${favicon.url}">
The output will be similar to the following:
<link rel="shortcut icon" href="/static/favicon-c3deb101.ico">
FAQs
A taglib to use Marko with Lasso
The npm package @lasso/marko-taglib receives a total of 954 weekly downloads. As such, @lasso/marko-taglib popularity was classified as not popular.
We found that @lasso/marko-taglib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.