Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
es6ish-string-format
Advanced tools
An ES5 JavaScript string formatter compatible with ES6-style template strings
An JavaScript string formatter that is mostly compatible with ES6 template strings.
In a browser:
<script src="format.js"></script>
Via bower:
bower install es6ish-string-format
This method will attach itself to the String prototype. That means that once you include it, you can use it like this:
var test = 'test';
console.log('this is a ${test}'.format({ test: test }));
// = 'this is a test'
It can also access object attributes, like so:
var user = { username: 'cdmckay' };
console.log('hello, ${user.username}'.format({ user: user }));
// = 'hello, cdmckay'
This format method was designed to have a migration path to ES6 template strings. So, if you wanted to convert
the above example to an ES6 template string, simple replace the quotes with backticks and delete the .format(...)
part:
var user = { username: 'cdmckay' };
console.log(`hello, ${user.username}`);
// = 'hello, cdmckay'
Cameron McKay |
This library is available under the MIT license.
FAQs
An ES5 JavaScript string formatter compatible with ES6-style template strings
The npm package es6ish-string-format receives a total of 2 weekly downloads. As such, es6ish-string-format popularity was classified as not popular.
We found that es6ish-string-format 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.