
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Virastar is a Persian text cleaner.
A javascript port of aziz/virastar with lots of help from ebraminio/persiantools
see live demo
npm install virastar
var Virastar = require('virastar');
var virastar = new Virastar();
virastar.cleanup("فارسي را كمی درست تر می نويسيم"); // Outputs: "فارسی را کمی درستتر مینویسیم"
<script src="lib/virastar.js"></script>
<script>
var virastar = new Virastar();
alert(virastar.cleanup("فارسي را كمی درست تر می نويسيم"));
</script>
Type: string
string of persian source to be cleaned.
Type: object
Virastar("سلام 123" ,{"fix_english_numbers":false}); // Outputs: "سلام 123"
Virastar comes with a list of options to control its behavior.
normalize_eoldefault: true
\n)decode_htmlentitiesdefault: true
fix_dashesdefault: true
fix_three_dotsdefault: true
normalize_ellipsisdefault: true
remove_spaces_before_ellipsisdefault: true
normalize_datesdefault: true
fix_english_quotes_pairsdefault: true
“”) with their persian equivalent («»)fix_english_quotesdefault: true
fix_hamzehdefault: true
ه followed by (space|ZWNJ|lrm) follow by ی with هٔه followed by (space|ZWNJ|lrm|nothing) follow by ء with هٔهٓ or single-character ۀ with the standard هٔfix_hamzeh_arabicdefault: false
ة to هٔcleanup_rlmdefault: true
cleanup_zwnjdefault: true
­) into zwnj¬) into zwnjfix_arabic_numbersdefault: true
fix_english_numbersdefault: true
fix_numeral_symbolsdefault: true
fix_misc_non_persian_charsdefault: true
fix_punctuationsdefault: true
,, ; with its persian equivalentfix_question_markdefault: true
fix_perfix_spacingdefault: true
mi*, nemi*, bi*fix_suffix_spacingdefault: true
*ha, *haye*am, *at, *ash, *ei, *eid, *eem, *and, *man, *tan, *shan*tar, *tari, *tarin*hayee, *hayam, *hayat, *hayash, *hayetan, *hayeman, *hayeshanfix_suffix_miscdefault: true
ه followed by ئ or ی, and then by ی, with هایfix_spacing_for_braces_and_quotesdefault: true
(), [], {}, “” and «»fix_spacing_for_punctuationsdefault: true
fix_diacriticsdefault: true
remove_diacriticsdefault: false
fix_persian_glyphsdefault: true
fix_misc_spacingdefault: true
cleanup_spacingdefault: true
cleanup_line_breaksdefault: true
cleanup_begin_and_enddefault: true
markdown_normalize_bracesdefault: true
[] and () ([text] (link) into [text](link))! and opening brace (! [alt](src) into )(), [], {} ([[ text ]] into [[text]])(), [], {} ([[text] ] into [[text]])markdown_normalize_listsdefault: true
-, * or #skip_markdown_ordered_lists_numbers_conversiondefault: false
cleanup_extra_marksdefault: true
?! into !?kashidas_as_parentheticdefault: true
cleanup_kashidasdefault: true
preserve_frontmatterdefault: true
preserve_HTMLdefault: true
preserve_commentsdefault: true
preserve_entitiesdefault: true
preserve_URIsdefault: true
preserve_bracketsdefault: false
[])preserve_bracesdefault: false
{})preserve_nbspsdefault: true
This software is licensed under the MIT License. View the license.
FAQs
Cleaning-up Persian Texts!
We found that virastar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.