0.1.0 • Published 1 year ago

nestjs-slug v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago