Permutant is a JavaScript/TypeScript and Dart framework to find every possible permutation of an array (or list in Dart) of data.
Created with ❤️ by @markmusic2727 and @filippofonseca
Permutant allows for seamless and easy use of complex algorithms (like Heap's Algorithm) to find every possible permutation of an array/list. Algorithms like these usually take a general understanding of computer science and mathematical concepts, like recursion and factorials, to recreate. Instead of spending valueble time grasping these conceps, simply create a Permutant instance. That is all it takes.
Permutant is not limited to single language architecture. It was designed and optimized to work with TypeScript, and Dart. With cohesive imports and fuctionality, Permutant keeps both codebases consistent, allowing for Permutant to remain the same on all languages.
Ensure that you have the latest version of Node and npm (if using TS) or Dart installed.
1. Add Permutant to Dependancies
In your pubspec.yaml
file, add the following to your dependancies:
dependencies:
...
permutant: ^1.0.15
2. Initiaization
At the top of your Dart file, import the permutant
package, as shown:
import 'package:permutant/dart/permutant.dart';
1. Installation with npm
npm i permutant
2. Initiaization
At the top of your TypeScript file, import permutant
, as shown:
import Permutant from "permutant";
NOTE: The name Permutant after import is arbitrary; it can be replaced with whatever you'd like and the code will still run properly:
import Foo from "permutant";
Want to know more about what goes behing the scenes in Permutant? We, at Permutant, have made a comprehensive lesson on all of the math behind Heap's Algorithm. Check out the lesson here.
If you want to know more about the functions and the different methods that can be called with Permutant, view the documentation here.