
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
re-write-js
Advanced tools
Yet another translator, created because I needed something simple.
This is just a syntax for writing simple String transformation functions. For example:
var translate = require("re-write-js").buildTranslatorFn({
"Hi {x}!" : "Salut {x} !",
"{x} plus {y} equals {z}" : "L'addition de {x} et {y} donne {z}",
'"{}"' : "« {} »",
"I have {} apples" : function(x){
if (x < 0) return "J'ai un déficit de pommes";
if (x == 0) return "Je n'ai pas de pommes";
if (x == 1) return "J'ai une pomme";
if (x == 2) return "J'ai deux pommes";
return "J'ai "+x+" pommes"; }
}, {name: "Wojtek"});
translate('Hi {name}!');
// Salut Wojtek !
translate('Hi {name}!', {name: "Anne"});
// Salut Anne !
translate('Hi {=Ben}!');
// Salut Ben !
translate('{x} plus {y} equals {z}', {x:1, y:2, z: 1 + 2});
// L'addition de 1 et 2 donne 3
translate(`{=2} plus {=2} equals {=${2+2}}`);
// L'addition de 2 et 2 donne 4
translate('"{str}"', {str: "Bonjour!"});
// « Bonjour! »
translate('{=Bonsoir!}');
// « Bonsoir! »
translate("I have {y} apples",{y:2+3});
// J'ai 5 pommes
translate("I have {=0} apples");
// Je n'ai pas de pommes
translate("I have {y} apples",{y:'Ho!'});
// J'ai Ho! pommes
FAQs
Another translator generator (for, e.g., internationalization)
We found that re-write-js 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.