
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Strip whitespace (or other characters) of a string.
Via npm
npm install trim-php
Via Yarn
yarn add trim-php
Import Package in Node.js
.
const trimPhp = require('trim-php').default;
Import Package in React
.
import trimPhp from 'trim-php';
const trim = require('trim-php');
const str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With lTrim: ', trim.lTrim(str));
const trimPhp = require('trim-php').default;
const str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With lTrim: ', new trimPhp().lTrim(str));
const trim = require('trim-php');
const str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With rTrim: ', trim.rTrim(str));
const trimPhp = require('trim-php').default;
const str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With rTrim: ', new trimPhp().rTrim(str));
const trim = require('trim-php');
const str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With trimPhp: ', trim.trimPhp(str));
const trimPhp = require('trim-php').default;
const str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With trim: ', new trimPhp().trim(str));
import trim from 'trim-php';
var str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With trimPhp: ', trim.trimPhp(str));
import trimPhp from 'trim-php';
const str = '\n Hello World! \n';
console.log('Without Trim: ', str);
console.log('With trimPhp: ', new trimPhp().trim(str));
Attributes | Type | Required | Description |
---|---|---|---|
str | String | Yes | Specifies the string to check. |
charList | String | No | Specifies which characters to remove from the string. |
Returns the modified string.
This package is tested with the Node.js
and React
Application.
FAQs
Strip whitespace (or other characters) of a string.
The npm package trim-php receives a total of 73 weekly downloads. As such, trim-php popularity was classified as not popular.
We found that trim-php 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.