2.0.0 • Published 2 years ago

rollup-plugin-pound v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

rollup-plugin-pound

Get rid of those pesky American $ signs in your Javascript template literals—replace them with good old British £ symbols, or any other supported currency!

Example

Add it to your Rollup plugin list:

import currencyPlugin from 'rollup-plugin-pound'
// rollup.config.js
export default {
 ...
 plugins: [
        currencyPlugin()
    ]
 ...
}

And watch as

// Your code
console.log(`Hello £{process.argv[2]}`);

is transformed to

// Transpiled code
console.log(`Hello ${process.argv[2]}`);

Perfect!

It even supports other currencies! Just provide the currency code like so:

// rollup.config.js
export default {
 ...
 plugins: [
        currencyPlugin({currency: "EUR"})
    ]
 ...
}

And watch as

// Your code
console.log(`Hello €{process.argv[2]}`);

is transformed to

// Transpiled code
console.log(`Hello ${process.argv[2]}`);

It goes without saying that USD isn't supported though—no need to transpile when you have native browser support!

No guarantees are provided as to whether currency symbols not in template strings will be transpiled