This package will check if two words / strings are anagrams. https://en.wikipedia.org/wiki/Anagram
It's available on npm.
npm install --save is-anagram
const isAnagram = require('is-anagram');
isAnagram('silent', 'listen') // true
isAnagram('rail safety', 'fairy tales') // true
isAnagram('silent', 'lamb') // false
isAnagram('silent', []) // false
$ npm test
Contributions are appreciated.
MIT licensed. See LICENSE.