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.
@e-goi/css-inliner
Advanced tools
Inline your css 100% in the browser and with no dependencies
To install the package, you can use npm or yarn:
yarn add @e-goi/css-inliner
Import the package on your code
import { cssInliner } from '@e-goi/css-inliner';
Use the main function cssInliner
to inject the style on the elements.
cssInliner(
document.querySelector('html').innerHTML,
{
properties: {
width: true,
border: true,
cellpadding: true,
cellspacing: true
}
}
).then(formatted => {
console.log(formatted);
});
The second parameter of cssInliner
is a configuration object.
Configuration | Type | Default | Description |
---|---|---|---|
url | string | empty | url to replace on relative path src and href |
preserveMediaQueries | boolean | true | define if preserver or not @media queries |
apply | ApplyTags | - | tags to get the styles |
properties | ApplyProperties | - | apply style to some attributes |
remove | RemoveTags | - | remove tags after set the css inline |
Configuration | Type | Default | Description |
---|---|---|---|
style | boolean | true | apply style tags |
link | boolean | true | apply content from link tags |
Configuration | Type | Default | Description |
---|---|---|---|
width | boolean | false | apply width style to width property |
border | boolean | false | apply border style to table border property |
cellpadding | boolean | false | apply td padding style to table cellpadding property |
cellspacing | boolean | false | apply border-spacing style to table cellspacing property |
Configuration | Type | Default | Description |
---|---|---|---|
style | boolean | true | remove style tags |
link | boolean | true | remove link tags |
script | boolean | true | remove script tags |
FAQs
Inline your css 100% in the browser and with no dependencies
We found that @e-goi/css-inliner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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’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.