Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
formatjs-helper
Advanced tools
FormatJSHelper is a simple wrapper for your localization message data that makes working with data in the formats needed by FormatJS easy.
FormatJSHelper is a simple wrapper for your localization message data that makes working with data in the formats needed by FormatJS easy.
To start, create an instance of the class with your message data (formatted according to ICU Message Syntax) as the single parameter:
var formatJSHelper = new FormatJSHelper({
locales: 'en-US',
messages: {...}
});
Then you're ready to use FormatJSHelper. A simple usage is getting a string from your messages:
formatJSHelper.get('path', 'to', 'your', 'message');
If you want to format that message using FormatJS's IntlMessageFormat, this is what you would do:
var message = new IntlMessageFormat(formatJSHelper.get('path', 'to', 'your', 'message'), formatJSHelper.getLocale());
message.format();
If you're using FormatJS with templates, the format that the localization data is required in is slightly different, but you can easily fetch what you need in this format like this:
myHandlebarsTemplate({
...
}, formatJSHelper.getOptions());
To see all methods available for FormatJSHelper, check out the well-documented source!
Tests are located in the spec/
folder. You can run them with the command:
jasmine
This project is licensed under the Apache License v2.0. See LICENSE.md.
FAQs
FormatJSHelper is a simple wrapper for your localization message data that makes working with data in the formats needed by FormatJS easy.
We found that formatjs-helper 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.