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.
The path-case npm package is used to convert strings to path case, which is a lowercase format with words separated by slashes. This is particularly useful for creating URL paths or file paths in a consistent format.
Convert string to path case
This feature converts a given string to path case, where each word is separated by a slash and all characters are in lowercase.
const pathCase = require('path-case');
const result = pathCase('Hello World');
console.log(result); // Output: 'hello/world'
The lodash.kebabcase package converts strings to kebab case, which is similar to path case but uses hyphens instead of slashes. It is part of the larger Lodash utility library, which offers a wide range of functions for manipulating arrays, objects, and strings.
The change-case package provides a variety of string case transformations, including camel case, snake case, and path case. It is a versatile library that can handle multiple case conversions, making it more comprehensive compared to path-case.
The param-case package converts strings to param case, which is similar to path case but uses hyphens instead of slashes. It is part of the change-case family of packages, which offers various string case transformations.
Transform into a lower case string with slashes between words.
npm install path-case --save
import { pathCase } from "path-case";
pathCase("string"); //=> "string"
pathCase("dot.case"); //=> "dot/case"
pathCase("PascalCase"); //=> "pascal/case"
pathCase("version 1.2.10"); //=> "version/1/2/10"
The function also accepts options
.
MIT
FAQs
Transform into a lower case string with slashes between words
The npm package path-case receives a total of 5,602,650 weekly downloads. As such, path-case popularity was classified as popular.
We found that path-case 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.
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.