
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
amp-email-generator
Advanced tools
This is a set of functions that will generate valid AMP email markup
getImage({ attributes, fallback })
Ex.
const attributes = {
src: "example.com/my-image.jpg",
layout: "fixed",
height: 400,
width: 400
}
const { html, css, scripts } = getImage({ attributes, fallback: "<span>Fallback Text</span>" });
will result in
<amp-img src="example.com/my-image.jpg" layout="fixed" height="400" width="400">
<span>Fallback Text</span>
</amp-img>
getAccordion({ sections, accordionAttributes, sectionAttributes })
Ex.
const sections = [
{ header: "<h1>Hello</h1>", content: "<p>World</p>" },
{ header: "<h1>Goodbye</h1>", content: "<p>World</p>", expanded: true }
]
const { html, css, scripts } = getImage({
sections,
accordionAttributes: { animate: true },
sectionAttributes: { class: "my-section" }
});
will result in
<amp-accordion animate>
<section class="my-section">
<h1>Hello</h1>
<p>World</p>
</section>
<section expanded class="my-section">
<h1>Goodbye</h1>
<p>World</p>
</section>
</amp-accordion>
getForm({ formAttributes, fields, submitLabel, success, error })
Ex.
const fields = [
{
type: "text",
name: "test-text",
fields: [
{
label: "Test Text Input",
id: "test"
}
]
},
{
type: "radio",
name: "test-radio",
fields: [
{
label: "Test Radio A",
id: "a",
value: "a"
},
{
label: "Test Radio B",
id: "b",
value: "b"
},
{
label: "Test Radio C",
id: "c",
value: "c"
}
]
}
];
const formAttributes = {
target: "_blank",
action: "post",
"action-xhr": "example.com/xhr"
}
const { html, css, scripts } = getForm({
fields,
formAttributes,
success: "Hooray!",
error: "Oh no!",
submitLabel: "This is the submit button!"
});
will result in
<form target="_blank" action="post" action-xhr="example.com/xhr">
<label for="test-text">Test Text Input</label>
<input type="text" id="test" name="test-text">
<input type="radio" id="a" name="test-radio" value="a" >
<label for="test-radio">Test Radio A</label>
<input type="radio" id="b" name="test-radio" value="b" >
<label for="test-radio">Test Radio B</label>
<input type="radio" id="c" name="test-radio" value="c" >
<label for="test-radio">Test Radio C</label>
<input type="submit" value="Submit">
<div submit-success>
Tada!
</div>
<div submit-error>
Oh no!
</div>
</form>
FAQs
Generator functions for AMP Email components
The npm package amp-email-generator receives a total of 0 weekly downloads. As such, amp-email-generator popularity was classified as not popular.
We found that amp-email-generator 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.