npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@libs-ui/pipes-format-text-first-letter-to-uppercase

v0.2.356-25

Published

Pipe Angular viết hoa chữ cái **đầu tiên của chuỗi** (sentence case), hỗ trợ nhiều tùy chọn format text.

Downloads

1,223

Readme

First Letter To UpperCase Pipe

Pipe Angular viết hoa chữ cái đầu tiên của chuỗi (sentence case), hỗ trợ nhiều tùy chọn format text.

Cài đặt

npm install @libs-ui/pipes-format-text-first-letter-to-uppercase

Import

import { LibsUiPipesFormatTextFirstLetterToUpperCasePipe } from '@libs-ui/pipes-format-text-first-letter-to-uppercase';

Sử dụng

Trong Template

<!-- Cơ bản -->
<p>{{ 'hello world' | LibsUiPipesFormatTextFirstLetterToUpperCasePipe }}</p>
<!-- Output: Hello world -->

<!-- Sentence case (lowercase toàn bộ + hoa chữ đầu) -->
<p>{{ 'HELLO WORLD' | LibsUiPipesFormatTextFirstLetterToUpperCasePipe:{lowercaseOtherCharacter: true} }}</p>
<!-- Output: Hello world -->

<!-- Xóa emoji -->
<p>{{ '👋 hello world' | LibsUiPipesFormatTextFirstLetterToUpperCasePipe:{removeEmoji: true, trim: true} }}</p>
<!-- Output: Hello world -->

Dùng trong TypeScript

Pipe là thin wrapper của hàm firstLetterToUpperCase trong @libs-ui/utils. Khi cần gọi trong TypeScript, import và dùng thẳng hàm đó — không cần inject pipe:

import { firstLetterToUpperCase } from '@libs-ui/utils';

// Cơ bản
const result = firstLetterToUpperCase('hello world');
// Output: 'Hello world'

// Với options (sentence case):
const sentenceCase = firstLetterToUpperCase('HELLO WORLD', {
  lowercaseOtherCharacter: true,
  trim: true,
});
// Output: 'Hello world'

API

Syntax

value | LibsUiPipesFormatTextFirstLetterToUpperCasePipe : options

Parameters

| Parameter | Type | Default | Description | | --------------------------------- | --------- | -------- | ---------------------------------------------------- | | value | string | required | Chuỗi cần format | | options.uppercaseOtherCharacter | boolean | false | Viết hoa tất cả ký tự | | options.lowercaseOtherCharacter | boolean | false | Viết thường các ký tự còn lại (không phải đầu chuỗi) | | options.trim | boolean | false | Loại bỏ khoảng trắng đầu/cuối | | options.removeMultipleSpace | boolean | false | Thay thế nhiều khoảng trắng liên tiếp bằng một | | options.removeEmoji | boolean | false | Loại bỏ emoji khỏi chuỗi | | options.removeUnicode | boolean | false | Loại bỏ dấu unicode |

ITextFormatOptions Interface

interface ITextFormatOptions {
  uppercaseOtherCharacter?: boolean; // Viết hoa tất cả
  lowercaseOtherCharacter?: boolean; // Viết thường các ký tự còn lại
  trim?: boolean; // Trim khoảng trắng
  removeMultipleSpace?: boolean; // Xóa khoảng trắng thừa
  removeEmoji?: boolean; // Xóa emoji
  removeUnicode?: boolean; // Xóa dấu unicode
}

Sự khác biệt với Capitalize Pipe

| Pipe | Input | Output | | ------------------------ | --------------- | --------------- | | firstLetterToUpperCase | 'hello world' | 'Hello world' | | capitalize | 'hello world' | 'Hello World' |

  • FirstLetterToUpperCase: Chỉ viết hoa ký tự đầu tiên của toàn bộ chuỗi (sentence case)
  • Capitalize: Viết hoa ký tự đầu mỗi từ (title case)

Hidden Logic

  • Thứ tự xử lý options: uppercaseOtherCharacterlowercaseOtherCharacterremoveMultipleSpaceremoveEmojiremoveUnicodetrim → viết hoa ký tự đầu tiên
  • Guard clause: Nếu chuỗi đầu vào là null, undefined, hoặc rỗng, pipe trả về nguyên giá trị ban đầu (không throw error)
  • Position 0: Sử dụng uppercaseByPosition(text, 0) — viết hoa ký tự tại vị trí 0

Demo

Xem demo tại: pipes/format-text/first-letter-to-upperCase