0.1.0 • Published 2 years ago

nestjs-slug v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

nestjs-slug

It's a simple idea for changing any text into a slug for the url.

Install it

$ npm install nestjs-slug --save

Package uses

The package consists of two methods:

generateSlug(text: string, options?: {
    seperator?: string;
    lowerCase?: boolean;
    upperCase?: boolean;
    length?: number;
    trim?: boolean;
    timestamp?: boolean;
    trimBySepator?: number;
    removeSpecialCharacters?: boolean;
}) : string
  isSlug(text: string): boolean  <-- to check if a slug

Examples

importing SlugService in app.service.ts:

  import { Injectable } from '@nestjs/common';
  import { SlugService } from 'nestjs-slug'; <---

  @Injectable()
  export class AppService {

    slug:string = "";

    constructor(
      private slugService: SlugService  <---
    ){}

    this.slug = this.slugService.generateSlug("iphone 14 pro max black")
    
  }

License

nestjs-slug is MIT licensed.

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago