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.
@docusaurus/utils
Advanced tools
@docusaurus/utils is a utility package for Docusaurus, a popular static site generator. It provides various helper functions and utilities to streamline the development and customization of Docusaurus sites.
Path Utilities
This feature provides utilities for resolving and manipulating file paths, which is essential for managing the structure of a Docusaurus site.
const { resolvePathname } = require('@docusaurus/utils');
const resolvedPath = resolvePathname('/docs', '/baseUrl');
console.log(resolvedPath); // Outputs: '/baseUrl/docs'
Markdown Utilities
This feature includes functions to parse and manipulate Markdown content, which is a core part of creating documentation with Docusaurus.
const { parseMarkdownString } = require('@docusaurus/utils');
const markdownContent = '# Hello World';
const parsedContent = parseMarkdownString(markdownContent);
console.log(parsedContent); // Outputs parsed markdown content as an object
Data Normalization
This feature helps in normalizing URLs, ensuring that they are consistent and correctly formatted across the site.
const { normalizeUrl } = require('@docusaurus/utils');
const normalizedUrl = normalizeUrl(['https://example.com', 'docs']);
console.log(normalizedUrl); // Outputs: 'https://example.com/docs'
Lodash is a modern JavaScript utility library delivering modularity, performance, and extras. It provides a wide range of utility functions for common programming tasks, similar to the utility functions provided by @docusaurus/utils but more general-purpose.
Marked is a fast, lightweight Markdown parser and compiler. It is similar to the Markdown utilities provided by @docusaurus/utils but focuses solely on parsing and compiling Markdown.
The 'path' module in Node.js provides utilities for working with file and directory paths. It is similar to the path utilities in @docusaurus/utils but is a core module in Node.js and not specific to Docusaurus.
2.0.0-alpha.32 (2019-11-04)
<Redirect>
component for client side redirect. Example Usage:import React from 'react';
import {Redirect} from '@docusaurus/router';
function Home() {
return <Redirect to="/docs/test" />;
}
CodeBlock
theme component, it is recommended to update your source code to have this feature. (#1860)@theme/Tabs
component to be able to create tabs with only one item.@theme/Heading
component. If there is no id, it should not create anchor link.themeConfig.algolia
is not defined, the custom searchbar won't appear. If you've swizzled Algolia SearchBar
component before, please update your source code otherwise CSS might break. See #1909 for reference.- <Fragment>
+ <div className="navbar__search" key="search-box">
USE_SSH
env variable during deployment to be the same as in v1.docs/
or /docs/xxxx
that does not match any existing doc page should return 404 (Not found) page, not blank page. (#1903)@docusaurus/core
dependencies/ node_modules over user's node_modules. This fix a bug whereby if user has core-js@3 on its own node_modules but docusaurus depends on core-js@2, we previously encounter Module not found: core-js/modules/xxxx
(because core-js@3 doesn't have that)./docs
route even if docs folder is empty. We also improved docs plugin test coverage to 100% for stability before working on docs versioning. (#1912)/blog/post-xxx
will request for next and prev blog post metadata too aside from target post metadata. We should only request target post metadata. (#1908)FAQs
Node utility functions for Docusaurus packages.
The npm package @docusaurus/utils receives a total of 266,881 weekly downloads. As such, @docusaurus/utils popularity was classified as popular.
We found that @docusaurus/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.