
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
friendly-name-parser
Advanced tools
A module that allows for the normalization of usernames and validation to detect HTML, JS, or PHP code.
friendly-name-parser
is a library for Node.js that assists in processing user names into easily readable strings.
The goal of this library is to enhance the readability and security of input data in web applications.
The FriendlyNameParser module was designed to enhance the account registration processes in web applications. It enables the processing and normalization of input data, which increases the security and readability of information provided by users.
To install this module in a Node environment, use the following npm command:
npm install friendly-name-parser
If you want to use this module in a browser, you can use the following HTML code:
<script src="https://cdn.jsdelivr.net/npm/friendly-name-parser@1/dist/friendly-name-parser.min.js"></script>
const FriendlyNameParser = require('friendly-name-parser');
const myUsername = 'I LOVE CUTE cats!!! 💞😻';
const data = FriendlyNameParser(myUsername);
console.log(data.pretty); // "I Love Cute Cats"
'<h1>Hello World</h1>'; // "Hello World"
'<script>alert("Hello World")</script>'; // "Hello World"
'😺🔢🤔neko🕵️♀️🔥😸📷⚠'; // "Neko"
'sefinek@example.com'; // "Sefinek"
' Hello World '; // "Hello World"
'Hello... World'; // "Hello World"
'Goodbye world 😥🌍👋'; // "Goodbye World"
const FriendlyNameParser = require('friendly-name-parser');
const myUsername = '😻I !!LOVE!! CaTs 💞';
const data = FriendlyNameParser(myUsername);
console.log(data);
// Output:
// {
// input: '😻I !!LOVE!! CaTs 💞',
// pretty: 'I Love Cats',
// isHTML: false,
// isJS: false,
// isPHP: false,
// breakSpaces: false,
// hasMultilineComments: false,
// isPlainText: true,
// detected: []
// }
const FriendlyNameParser = require('friendly-name-parser');
const myUsername = '<script>alert("l itt le gat ito");</script>';
const data = FriendlyNameParser(myUsername);
console.log(data);
// Output:
// {
// input: '<script>alert("l itt le gat ito");</script>',
// pretty: 'Little Gatito',
// isHTML: true,
// isJS: true,
// isPHP: false,
// breakSpaces: true,
// hasMultilineComments: false,
// isPlainText: false,
// detected: [ 'HTML', 'JS', 'Break spaces' ]
// }
You can find a larger collection of examples in the examples folder.
If you encounter any issues or have questions regarding the use of friendly-name-parser, please submit an Issue in the GitHub repository.
The module is available under the MIT license. Details can be found in the LICENSE file in the root directory of the repository.
FAQs
A module that allows for the normalization of usernames and validation to detect HTML, JS, or PHP code.
The npm package friendly-name-parser receives a total of 1 weekly downloads. As such, friendly-name-parser popularity was classified as not popular.
We found that friendly-name-parser 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.