Package Exports
- tagged-template-permutations
- tagged-template-permutations/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tagged-template-permutations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Permutations - Tagged Template Literal
A utility to generate permutations and combinations from template literal expressions. Useful for generating a list of phrases or keywords with varying parts.
Installation
To install tagged-template-permutations
, use npm:
npm install tagged-template-permutations
Or using yarn:
yarn add tagged-template-permutations
Usage
Import permutations in your TypeScript or JavaScript project:
import { permutations } from 'tagged-template-permutations'
const roles: string[] = ['Founder', 'Builder'];
const types: string[] = ['Startup', 'Nonprofit'];
const results = permutations`${roles} of a ${types}`;
console.log(results);
// Output: ['Founder of a Startup', 'Founder of a Nonprofit', 'Builder of a Startup', 'Builder of a Nonprofit']
API Reference
permutations`<template literal>`
Generates a list of permutations based on the provided template literal.
- Template literals may contain arrays or strings.
- The function returns an array of strings with all unique permutations. Contributing
We welcome contributions to the permutations package.
License
This project is licensed under the MIT License.
Support
If you have any questions or issues, please open an issue on the GitHub repository issue tracker.