permutations.js is a simple javascript file used for generating all permutations of a given array, and all anagrams of a given string.
No installation necessary.
anagrams("PIE"); // Returns ["PIE", "PEI", "IPE", "IEP", "EPI", "EIP"]
permutations(123); // Returns [["1", "2", "3"], ["1", "3", "2"], ["2", "1", "3"], ["2", "3", "1"], ["3", "1", "2"], ["3", "2", "1"]]
Additional functions and optimization always welcome.
Free to use.