PHPackages                             tsoffereins/nano - 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. [Framework](/categories/framework)
4. /
5. tsoffereins/nano

ActiveFramework[Framework](/categories/framework)

tsoffereins/nano
================

A nano sized framework with the bare minimum for simple applications.

v2.0.0(5y ago)318[1 issues](https://github.com/tsoffereins/nano/issues)MITPHPPHP ^8.0CI failing

Since Oct 1Pushed 5y ago2 watchersCompare

[ Source](https://github.com/tsoffereins/nano)[ Packagist](https://packagist.org/packages/tsoffereins/nano)[ Docs](https://github.com/tsoffereins/nano)[ RSS](/packages/tsoffereins-nano/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Nano framework
==============

[](#nano-framework)

Nano is a teeny tiny framework that offers the bare minimum for you to create, for example, a very slim and super quick API.

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

[](#installation)

Installation can be done using [Composer](https://getcomposer.org/) to download and install Nano framework as well as its dependencies.

```
composer require nano/framework

```

Building blocks
---------------

[](#building-blocks)

The Nano framework contains the following classes:

- `Nano\Container` - An IoC container for dependency injection
- `Nano\PipeLine` - A middleware bus
- `Nano\Router` - A router for defining endpoints

### Container

[](#container)

Using the container:

```
$container = new Container();

$container->bind('abstract', 'concrete');

$instance = $container->make('abstract');
```

Binding a callback:

```
$container->bind('abstract', function()
{
    return new Concrete('config');
});
```

Binding as a singleton:

```
$container->singleton('abstract', function()
{
    return new Concrete('config');
});
```

### PipeLine

[](#pipeline)

Using the PipeLine:

```
$pipe = $container->make('Nano\PipeLine');

$pipe->addMiddleare(['Middleware']);

$pipe->fire(function()
{
    return 'Hello world!';
}, $request);
```

Defining middleware:

```
class Middleware
{
    public function handle($request, $next)
    {
        // Do something with request

        $response = $next($request);

        // Do something with response

        return $response;
    }
}
```

### Router

[](#router)

Using the Router:

```
$router = $container->make('Nano\Router');

$router->addRoutes(['/home', 'Controller@index']);

echo $router->match($_SERVER['REQUEST_URI']);
```

Defining a controller:

```
class Controller
{
    public function index()
    {
        return 'Hello world!';
    }
}
```

Route parameters:

```
$router->addRoutes(['/user/:id', 'Controller@user']);
```

Request methods:

```
$router->addRoutes([
    '/home', 'Controller@index', // defaults to GET
    'POST=/user/',
    'GET=/user/:id',
    'PUT=/user/:id',
    'DELETE=/user/:id'
]);
```

Support
-------

[](#support)

Please file issues here at Github

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~476 days

Total

3

Last Release

1876d ago

Major Versions

v1.1.0 → v2.0.02021-05-11

PHP version history (2 changes)v1.0.0PHP ^7.1

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4030108?v=4)[Thomas Offereins](/maintainers/tsoffereins)[@tsoffereins](https://github.com/tsoffereins)

---

Top Contributors

[![tsoffereins](https://avatars.githubusercontent.com/u/4030108?v=4)](https://github.com/tsoffereins "tsoffereins (1 commits)")

---

Tags

frameworknano

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tsoffereins-nano/health.svg)

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

###  Alternatives

[hemp/presenter

Easy Model Presenters in Laravel

247608.3k1](/packages/hemp-presenter)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

68943.9k18](/packages/pestphp-pest-plugin-stressless)[wpstarter/framework

The WpStarter Framework - Laravel Framework for WordPress

1610.2k5](/packages/wpstarter-framework)

PHPackages © 2026

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