Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-kernode

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-kernode

Create new kernode template

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Kernode

  • Slim Node js framework with typescript

Collaborator are welcome

  • Fork repository and create PR to develop branch

npm init kernode

Packages Used

  • Express js
  • Socket.io
  • Knex

HTTP Routes

  • routes/web.ts

  • routes/api.ts

  • api

import { ApiRouter as Router } from '@kernode/core'
import ApiController from 'Controller/Http/ApiController'

Router.get('/', ApiController.index)

  • web
import { Router } from '@kernode/core'
import WebController from 'Controller/Http/WebController'

Router.get('/', WebController.index)

Socket

  • routes/socket.ts
import { SocketListener } from '@kernode/core'
import WebSocketController from 'Controller/Ws/WebSocketController'

SocketListener.on('message', WebSocketController.onMessage)

Event Emitter

  • routes/event.ts
import { EventListener } from '@kernode/core'
import EventController from 'Controller/Event/EventController'

EventListener.on('message', EventController.onMessage)

  • Emit from Controller using AppEventEmitter
import { AppEventEmitter } from '@kernode/core'
AppEventEmitter.emit('message', { vehicle: 'car' })

Database Migration

Models
import { Model } from '@kernode/core'

class User extends Model {
  tableName: string = 'users'

  id: string
  name: string
  email: string
  password: string
  created_at: string
  updated_at: string
}

export default new User()

let users = await User.query().where('id', 1)

Authentication

Hash
  • Hash.make('plainPasswordText') (string)

  • Hash.verify('plainPasswordText', hashedString) (bool)

Jwt Auth
  • Auth.token(userObjectPayload) (jwt token)

  • Auth.verify(userObjectPayload) (User Object Payload | false)

Storage (support Local and AWS S3)
  • Storage.store(file) path(string)

  • Storage.getStream(path, res) StreamObject

Production

  • npm run build && npm run serve

TODO

  • Mailer Class
    • SMTP
    • SES

FAQs

Package last updated on 18 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc