
Research
/Security News
Laravel Lang Compromised with RCE Backdoor Across 700+ Versions
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.
@supportjs/text
Advanced tools
Text <img alt="npm" src="https://img.shields.io/npm/v/@innocenzi/tex
A simple string builder. I sometimes found myself writting code like the following example:
// Huh
const text = `
Report for ${projectName}:
[${'='.repeat(progress)}${' '.repeat(rest)}] (${percent}%)
Time spent: ${timeSpent}
Lines: ${lines}
`;
The issue with this will be the broken indentation and the spaces at the start and the end. I wish there was a better way to build strings, but there is no clean method.
That is why I made this fluent string builder, which I will update according to my needs. With Text, you can do this:
// Do this
const text = Text.make(`Report for ${projectName}:`)
.append('[')
.append('='.repeat(progress))
.append(' '.repeat(rest))
.append(']')
.append('(', percent, '%)')
.line()
.line('Time spent: ', timeSpent)
.line('Lines: ', lines);
// Or just this
const text = Text.make()
.template(`
Report for ${projectName}:
[${'='.repeat(progress)}${' '.repeat(rest)}] (${percent}%)
Time spent: ${timeSpent}
Lines: ${lines}
`);
Additionally, the library offer a few more useful string manipulation methods, inspired by the Str utilities of the Laravel framework.
Install it via the NPM registry:
# Yarn
$ yarn add @innocenzi/text
# NPM
$ npm i @innocenzi/text
The library exposes a single Text object, which is the string builder. You can either instantiate it normally, or call the static make method.
import { Text } from '@innocenzi/text';
// This is the same
const text = Text.make('some optional text');
// as this
const text = new Text('some optional text');
makeCreates a new instance of the builder. The builder can be used to fluently chain methods, in order to pleasantly manipulate text.
Text.make('hello world');
randomGenerates a random alpha-numeric string.
Text.random(8);
// => AM5Ysvv8
There are a lot of methods available, each of them are documented with examples. Until I find a way to generate a nice documentation website based on the TSDoc comments, you will have to refer to them in the source. Though, for convenience, I added their names below.
Contributions are welcome, if you want to add useful methods. If you contribute, make sure to:
.prettierrc and a .editorconfigThank you!
FAQs
Install it via the NPM registry:
The npm package @supportjs/text receives a total of 0 weekly downloads. As such, @supportjs/text popularity was classified as not popular.
We found that @supportjs/text 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.

Research
/Security News
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.

Security News
Socket found a malicious postinstall hook across 700+ GitHub repos, including PHP packages on Packagist and Node.js project repositories.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain