Shows a banner on the CLI using a cool font.
For NodeJs & TypeScript. Depends on the amazing figlet
and chalk
libraries.
import figlet from 'figlet'
import chalk from 'chalk'
#!/usr/bin/env node | |
/* The API routes and middlewares */ | |
const server = () => import('express').then(({ default: express }) => { | |
const app = express() | |
app.get('/hello', (req, res) => { | |
res.json({ message: 'Hey there!' }) | |
}) | |
return app | |
}) |
locals { | |
region = "us-east-1" | |
namespace = "infrastructure" | |
} | |
provider "aws" { | |
region = local.region | |
} | |
module "vpc" { |
// This lets you emit and listen for events in a type-safe manner | |
// Awesome! | |
import { EventEmitter } from 'events' | |
type Type<Name> = { type: Name } | |
type Value<Type> = { value: Type } | |
export type TypedValue<T, V> = Type<T> & Value<V> |
whoami # run some command | |
echo $? # show the exit status code result of the command |
import low from 'lowdb' | |
import FileSync from 'lowdb/adapters/FileSync' | |
export const database = <T> (defaults: T) => { | |
const adapter = new FileSync<T>('db.json') | |
const db = low(adapter) | |
db.defaults(defaults).write() | |
return db | |
} |
import AWS from 'aws-sdk' | |
export default (process.env.IS_OFFLINE) | |
? new AWS.DynamoDB.DocumentClient({ | |
region: 'localhost', | |
endpoint: 'http://localhost:8000', | |
accessKeyId: 'NONE', | |
secretAccessKey: 'NONE' | |
}) | |
: new AWS.DynamoDB.DocumentClient() |
Increments the version and creates a git tag, pushes the tags to the remote, then publishes to npm.
npm version patch
git push && git push --tags
npm publish
process.stdout.write('\x1b[2J'); | |
process.stdout.write('\x1b[0f'); |