PHPackages                             glhd/ansipants - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. glhd/ansipants

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

glhd/ansipants
==============

0.0.2(2y ago)641[1 issues](https://github.com/glhd/ansipants/issues)MITPHP

Since Apr 17Pushed 2y ago2 watchersCompare

[ Source](https://github.com/glhd/ansipants)[ Packagist](https://packagist.org/packages/glhd/ansipants)[ RSS](/packages/glhd-ansipants/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

 [ ![Build Status](https://github.com/glhd/ansipants/workflows/PHPUnit/badge.svg) ](https://github.com/glhd/ansipants/actions) [ ![Coverage Status](https://camo.githubusercontent.com/f5c3c62ff78b8b74dfb6c5bf8b9667e517ae41f16f9b668f5187f3b04be1d6aa/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f30343736316336386664396463343663663630382f746573745f636f766572616765) ](https://codeclimate.com/github/glhd/ansipants/test_coverage) [ ![Latest Stable Release](https://camo.githubusercontent.com/1661f7633dbe133242f11168885d660de9dfd3314e3403928f77fc8cd0dd5e93/68747470733a2f2f706f7365722e707567782e6f72672f676c68642f616e736970616e74732f762f737461626c65) ](https://packagist.org/packages/glhd/ansipants) [ ![MIT Licensed](https://camo.githubusercontent.com/89053a568ac64a4a9ec0ad9a6cf2e6c817475cafc9ebad11d8dcf7d4609ea17d/68747470733a2f2f706f7365722e707567782e6f72672f676c68642f616e736970616e74732f6c6963656e7365) ](./LICENSE) [ ![Follow @inxilpro on Twitter](https://camo.githubusercontent.com/e6d0a3893c652423c3a7c6aa648ca6e98a3b06899551e17a2fe5b33528244dcb/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f696e78696c70726f3f7374796c653d736f6369616c) ](https://twitter.com/inxilpro)

ANSI Pants 👖💫
=============

[](#ansi-pants-)

Installation
------------

[](#installation)

```
composer require glhd/ansipants
```

Usage
-----

[](#usage)

You can instantiate a new ANSI string using the `ansi()` helper, with `new AnsiString()`, or with `AnsiString::make()`. All string manipulation functions can be chained, just like the Laravel `Stringable` class. Where appropriate, you can pass an additional `ignore_style: true`argument into a function to make that function ignore the ANSI styles that are applied (like color or font style).

An example:

```
ansi("\e[1mHello💥 \e[3mwo\e[0mrld")
  ->append(" 🥸🥸🥸")
  ->padLeft(100)
  ->wordwrap();
```

### Stringable Macro

[](#stringable-macro)

You can also create an ANSI string from any `Stringable` object:

```
Str::of("\e[1mHello💥 \e[3mwo\e[0mrld")->ansi();
// Or
str("\e[1mHello💥 \e[3mwo\e[0mrld")->ansi();
```

Resources
---------

[](#resources)

-
- [https://en.wikipedia.org/wiki/ANSI\_escape\_code](https://en.wikipedia.org/wiki/ANSI_escape_code)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

758d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21592?v=4)[Chris Morrell](/maintainers/inxilpro)[@inxilpro](https://github.com/inxilpro)

---

Top Contributors

[![inxilpro](https://avatars.githubusercontent.com/u/21592?v=4)](https://github.com/inxilpro "inxilpro (30 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (1 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (1 commits)")

---

Tags

laravel

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/glhd-ansipants/health.svg)

```
[![Health](https://phpackages.com/badges/glhd-ansipants/health.svg)](https://phpackages.com/packages/glhd-ansipants)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
