Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including reverse-component with all npm packages installed. Try it out:

var reverseComponent = require("reverse-component")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

reverse-component v0.0.1

unicode-aware string reversal

reverse

Unicode-aware string reverser. For more information, visit: https://github.com/mathiasbynens/esrever.

Installation

Install with component(1):

$ component install component/reverse

Or with node.js:

$ npm install reverse-component

Example

reverse('foo 𝌆 bar') // rab 𝌆 oof
reverse('mañana mañana') // anañam anañam

API

reverse(str)

Reverse a string

Credits

The logic and examples are originally from: https://github.com/mathiasbynens/esrever. This code is reformatted and simplified for component.

Test

npm install component-test
make test

License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free