Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/izolate/slugify
Converts a string to a slug, useful for URLs, filenames, IDs, and more
https://github.com/izolate/slugify
character converts-string dart slug slugify url
Last synced: about 2 months ago
JSON representation
Converts a string to a slug, useful for URLs, filenames, IDs, and more
- Host: GitHub
- URL: https://github.com/izolate/slugify
- Owner: izolate
- License: mit
- Created: 2014-07-28T15:44:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-08-15T20:49:57.000Z (4 months ago)
- Last Synced: 2024-10-11T23:09:02.576Z (2 months ago)
- Topics: character, converts-string, dart, slug, slugify, url
- Language: Dart
- Homepage: https://pub.dev/packages/slugify
- Size: 27.3 KB
- Stars: 22
- Watchers: 4
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# slugify
Converts any `String` to a **slug**. Useful for URLs, filenames, IDs, and more.
## Features
* Multi-language support
* Removes unfriendly characters
* Approximates replacements for characters not in the Latin alphabet
* Configurable options
* Null safe with Dart 2.12## Usage
```dart
import 'package:slugify/slugify.dart';// Use with default options.
var slug = slugify('Hello, World! Foo Bar');
print(slug); // hello-world-foo-bar// Use with custom options.
var slug2 = slugify('Hello, World! Foo Bar', lowercase: false, delimiter: '๐');
print(slug2) // Hello๐World๐Foo๐Bar
```### Options
Name | Type | Default | Description
--- | --- | --- | ---
`delimiter` | `String` | `"-"` | Separator between words
`lowercase` | `bool` | `true` | Convert text to lowercase