Installations
npm install angular-slugs
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
5.7.0
NPM Version
3.6.0
Score
65.4
Supply Chain
98.9
Quality
74.6
Maintenance
50
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Love this project? Help keep it running — sponsor us today! 🚀
Developer
garrettmac
Download Statistics
Total Downloads
1,403
Last Day
1
Last Week
1
Last Month
8
Last Year
66
GitHub Statistics
2 Stars
3 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
2.59 kB
Minified
1.26 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.1
Package Id
angular-slugs@1.0.1
Size
4.11 kB
NPM Version
3.6.0
Node Version
5.7.0
Total Downloads
Cumulative downloads
Total Downloads
1,403
Last day
0%
1
Compared to previous day
Last week
-50%
1
Compared to previous week
Last month
700%
8
Compared to previous month
Last year
-66.5%
66
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
6
angular-slug
Inspired by paulsmith's angular-slugify angular-slugs converts converts text into slugs or slugs into text with desired capitalization through a service and filter.
Installation
You can install the filter using Bower:
1$ bower install angular-slugs
Or npm:
1$ npm install angular-slugs
Then you have to include it in your HTML:
1<script src="bower_components/angular-slugs/angular-slug.js"></script> 2<script src="bower_components/angular-slugs/angular-unslug.js"></script> 3<script src="bower_components/angular-slugs/angular-capitalize.js"></script>
And inject the desired modules into your application:
1angular.module('webApp', ['capitalizer','slugifier','unslugifier']);
Service
The Slug
service provides a single function slug
that takes a string
input as argument and returns the slugified string.
1function MyCtrl($scope, Slug) { 2 $scope.slug = function(input) { 3 $scope.mySlug = Slug.slug(input); 4 }; 5}
or
1function MyCtrl($scope, Unslug) { 2 $scope.unslug = function(input) { 3 $scope.myUnslug = Unslug.slug(input); 4 }; 5}
Filter
To use add a slug
or unslug
pipe filter in your AngularJS curly-brace
expression.
Filters hello world
to hello-world
1<p>Slug: {{msg | slug}}</p>
Filters hello-world
to hello world
1<p>Unslug: {{msg | unslug}}</p>
Filters hello world
to Hello world
1<p>Unslug: {{msg | unslug| capitalize}}</p>
Filters hello world
to Hello World
1<p>Unslug: {{msg | unslug| capitalize:true}}</p>
Capitalize
You can use it like any other AngularJS filter:
First word only:
1<p>{{msg | capitalize}}</p>
First Letter In All Words:
1<p>{{msg | capitalize:true}}</p>
License
Copyright © 2016 Garrett M. team@cera.io
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
angular-slugs
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More