Slugify a string with comprehensive Unicode transliteration and extensive customization options
94
A utility that generates safe filenames from user-provided strings with performance optimizations for ASCII content.
Build a filename sanitizer that converts user input into filesystem-safe filenames. The system should handle both ASCII and non-ASCII content, optimizing performance when working with ASCII-only strings.
Requirements:
@generates
/**
* Generates a safe filename from user input with ASCII performance optimization
*
* @param {string} input - The user-provided string to convert
* @param {Object} options - Configuration options
* @param {boolean} options.preserveUnicode - If true, preserves non-ASCII characters instead of converting them
* @returns {string} A filesystem-safe filename
*/
function generateFilename(input, options = {}) {
// IMPLEMENTATION HERE
}
module.exports = { generateFilename };Provides string slugification with Unicode support and performance optimizations.
Install with Tessl CLI
npx tessl i tessl/npm-sindresorhus--slugifydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10