Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@burdy-cms/web-utils
Advanced tools
Powerful utilities to simplify usage of the Burdy on the web.
npm i @burdy-cms/web-utils
Creates a RewritesObject
instance that can be used to rewrite paths based on the configuration.
Accepts rewriteMap
and origin
(optional) as object parameters.
import { createRewrites } from '@burdy-cms/web-utils';
import axios from 'axios';
const rewrites = createRewrites({
origin: 'https://cms.website.com/api/content',
rewriteMap: [
{
source: '/:lang(fr|de)/:path*',
rewrites: {
page: '/sites/{lang}/{path}',
header: '/sites/{lang}/fragments/header',
footer: '/sites/{lang}/fragments/footer'
}
},
{
source: '/:path*',
rewrites: {
page: '/sites/en/{path}',
header: '/sites/en/fragments/header',
footer: '/sites/en/fragments/footer'
}
}
]
});
/**
Page = https://cms.website.com/api/content/sites/fr/fragments/home
Header = https://cms.website.com/api/content/sites/fr/fragments/header
Footer = https://cms.website.com/api/content/sites/fr/fragments/footer
**/
const { page, footer, header } = rewrites.rewrite('/fr/home');
// Fetch data from Burdy
const [pageRequest, footerRequest, headerRequest] = await Promise.all([
page,
footer,
header
]);
A function for converting Richtext (DraftJS) Editor content to plain HTML.
This is a forked version of draftjs-to-html
draftjs-to-html created by Jyoti Puri.
import { richtextToHtml } from '@burdy-cms/web-utils';
const rawContentState = BURDY_RICHTEXT_RESPONSE;
const markup = richtextToHtml(
rawContentState
);
Subscribes to Burdy preview (iframe parent). Returns a Subscription
that has unsubscribe()
method.
import { subscribeToPreview } from '@burdy-cms/web-utils';
const subscription = subscribeToPreview({
onEdit: post => {
updateView(post); // Updates view using new content
}
});
// Unsubscribe at some point if needed
subscription.unsubscribe();
Sends the updates to Burdy preview (iframe parent). This allows Burdy to know when you have switched the page on the frontend.
import { updatePreview } from '@burdy-cms/web-utils';
onRouterChange((pageData) => {
updatePreview(pageData);
});
FAQs
Burdy web utilities
We found that @burdy-cms/web-utils 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.