https://github.com/lucasconstantino/now-micro
The missing Micro builder for Now 2.0
https://github.com/lucasconstantino/now-micro
builder micro now
Last synced: 5 months ago
JSON representation
The missing Micro builder for Now 2.0
- Host: GitHub
- URL: https://github.com/lucasconstantino/now-micro
- Owner: lucasconstantino
- License: mit
- Created: 2019-01-03T05:52:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-20T15:51:43.000Z (almost 7 years ago)
- Last Synced: 2025-07-06T07:09:45.744Z (8 months ago)
- Topics: builder, micro, now
- Language: JavaScript
- Size: 398 KB
- Stars: 45
- Watchers: 5
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Now Micro
[](https://travis-ci.org/lucasconstantino/now-micro)
[](https://codecov.io/github/lucasconstantino/now-micro)
[](https://www.npmjs.com/package/now-micro)
Proper Micro builder for [Now 2.0](https://zeit.co/blog/now-2)
## Purpose
As of now, `@now/node` lambdas resemble a lot a [Micro](https://github.com/zeit/micro) environment, but it is just not that, which causes quite a lot of [unexpected](https://hyperion.alpha.spectrum.chat/zeit/now/504-lambda-invocation-timeout~dd711cf6-347d-4a91-83b3-c2ae097c4ce1) [results](https://github.com/zeit/now-builders/issues/133).
## Installation
`yarn add now-micro micro`
> Gotcha: so far we found no way to inject `micro` dependency during the build process, so it MUST be a dependency of your lambda, thus why we added it to the above command ;)
## Usage
Use `now-micro` in your builders on `now.json`:
```json
{
"version": 2,
"builds": [{ "src": "file.js", "use": "now-micro" }]
}
```
Develop your lambdas as a fully Micro compatible function:
```js
// ex. showing async usage and value returning (no res.end):
module.exports = async req => Promise.resolve(`Some result`)
```