Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
html-format
Advanced tools
Format HTML strings by indenting, wrapping, and removing unnecessary whitespace while preserving newlines.
npm install html-format
import format from "html-format";
const html = `\
<body>
<main class="grid"> </main>
</body>
`;
// indent = 2 spaces (default), width = 80 characters (default)
format(html) ==
`\
<body>
<main class="grid"> </main>
</body>
`;
// indent = 4 spaces, width = 80 characters (default)
format(html, " ".repeat(4)) ==
`\
<body>
<main class="grid"> </main>
</body>
`;
// indent = 4 spaces, width = 20 characters
format(html, " ".repeat(4), 20) ==
`\
<body>
<main
class="grid">
</main>
</body>
`;
FAQs
Format HTML strings.
The npm package html-format receives a total of 4,246 weekly downloads. As such, html-format popularity was classified as popular.
We found that html-format demonstrated a healthy version release cadence and project activity because the last version was released less than 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 researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.