Installations
npm install remove-trailing-spaces
Releases
Contributors
Developer
IonicaBizau
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
12.16.3
NPM Version
6.14.4
Statistics
4 Stars
19 Commits
3 Watching
1 Branches
1 Contributors
Updated on 07 Apr 2023
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
339,048,464
Last day
-27.8%
379,041
Compared to previous day
Last week
-7%
2,464,298
Compared to previous week
Last month
0.8%
10,860,795
Compared to previous month
Last year
25.7%
117,777,851
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
1
remove-trailing-spaces
Remove the trailing spaces from a string.
:cloud: Installation
1# Using npm 2npm install --save remove-trailing-spaces 3 4# Using yarn 5yarn add remove-trailing-spaces
:clipboard: Example
1const removeTrailingSpaces = require("remove-trailing-spaces"); 2 3let input = "Line 1 " 4 + "\n" + "Line 2 " 5 + "\n" + "Line 3 \t\t\t" 6 + "\n" + "Line 4 " + String.fromCharCode(160) 7 + "\n" + " " 8 + "\n" + "Line 6" 9 ; 10 11let res = removeTrailingSpaces(input); 12 13let oLines = input.split("\n"); 14res.split("\n").forEach((c, i) => { 15 console.log(`Removed ${oLines[i].length - c.length} spaces on line ${i + 1}`); 16 // Removed 5 spaces on line 1 17 // Removed 8 spaces on line 2 18 // Removed 8 spaces on line 3 19 // Removed 11 spaces on line 4 20 // Removed 19 spaces on line 5 21 // Removed 0 spaces on line 6 22});
:question: Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. :bug:
- For direct and quick help, you can use Codementor. :rocket:
:memo: Documentation
removeTrailingSpaces(input)
Remove the trailing spaces from a string.
Params
- String
input
: The input string.
Return
- String The output string.
:yum: How to contribute
Have an idea? Found a bug? See how to contribute.
:sparkling_heart: Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
-
Starring and sharing the projects you like :rocket:
-
—I love books! I will remember you after years if you buy me one. :grin: :book:
-
—You can make one-time donations via PayPal. I'll probably buy a
coffeetea. :tea: -
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
-
Bitcoin—You can send me bitcoins at this address (or scanning the code below):
1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
:dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
json-to-pretty-yaml
node-gtk
write-file-trim
ngindox
trailing-whitespaces
hasura-auto-aliases
profane-detect
@marcelorubim/json2yaml
:scroll: License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 14 are checked with a SAST tool
Score
3
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More