Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@types/mdurl
Advanced tools
TypeScript definitions for mdurl
The @types/mdurl package provides TypeScript type definitions for the mdurl library, which is a utility for encoding and decoding URLs in Markdown files. These type definitions allow TypeScript developers to use mdurl in a type-safe manner, ensuring that the correct types are used for URL processing functions. This package is particularly useful for developers working on Markdown processing tools or any applications that need to handle URLs within Markdown files.
Encoding URLs
This feature allows you to encode a URL to ensure it is safely and correctly represented in Markdown. The code sample demonstrates how to encode a URL containing non-Latin characters, making it suitable for inclusion in a Markdown file.
import { encode } from 'mdurl';
const encodedUrl = encode('https://example.com/путь?query=значение');
console.log(encodedUrl);
Decoding URLs
This feature enables the decoding of URLs that have been encoded. It's particularly useful for extracting the original URL from a Markdown file or any encoded string. The code sample shows how to decode a URL that was previously encoded, converting percent-encoded characters back to their original form.
import { decode } from 'mdurl';
const decodedUrl = decode('https://example.com/%D0%BF%D1%83%D1%82%D1%8C?query=%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5');
console.log(decodedUrl);
The 'url' package provides utilities for URL resolution and parsing. While it offers broader functionalities for handling URLs beyond just encoding and decoding, it does not include TypeScript type definitions out of the box, unlike @types/mdurl.
This package allows for creating, parsing, and formatting URL query strings. It's more focused on the query string aspect of URLs rather than the entire URL processing. Unlike @types/mdurl, it also does not come with TypeScript definitions by default, but it's highly useful for query string manipulation.
npm install --save @types/mdurl
This package contains type definitions for mdurl (https://github.com/markdown-it/mdurl#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdurl.
These definitions were written by Junyoung Choi.
FAQs
TypeScript definitions for mdurl
The npm package @types/mdurl receives a total of 2,901,045 weekly downloads. As such, @types/mdurl popularity was classified as popular.
We found that @types/mdurl 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.