This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
unicode-string-utils with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
...results in 2 when you would have been expecting 1.
unicodeStringUtils.length('💩'); // 1 unicodeStringUtils.symbols('Hello 🌍'); // ['H','e','l','l','o',' ','🌍'] unicodeStringUtils.slice('Boom 💣 Pow 💥', -12, 6); // Boom 💣 unicodeStringUtils.substring('Boom 💣 Pow 💥', 7, 12); // Pow 💥
npm install -g mocha mocha tests
As mentioned in the above blog post, with ES6 you probably won't need these utils.