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

ctl

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ctl

Controller module for NodeJS. Made to be extremely hackable and light!

  • 1.1.1
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ctl

ctl is the easiest way to manage everything with a project. specifically, it offers an opinionated framework for:

  • config (secret) management
  • easy db migration/model management
  • routes and handlers
  • html pages, styles and views
  • static assets
  • serverless hooks

Installation

yarn add ctl

Then to start a server, all you need to do is:

node -e 'require("ctl")()'

You can put this in the package.json like so:

{
  ...
  "scripts": {
    "start": "node -e 'require(\"ctl\")()'"
  }
}

And now you can run yarn start to start the server.

Please try it out! If you like it please say thank you. Or better, if you find bugs, have questions, or feedback, feel free to email me at me@leander.ca.

Libraries

const config = require('library/config');
const log = require('library/logging')('section');

Lifecycle

// load // connect // pre // migration // setup // start/serve // post

Advanced

Passing in options

Valid options:

  • src - where to look for the root of source code (defaults to /src)
  • models - where to look for models (defaults to /models folder in src)

More Information

The first version of ctl, way back in 2010, was built primarily as a way to manage controllers and handle server requests consistently. But with the advent of async/await, it's much easier to write logic nowadays. The goal of ctl, as it has always been, is to reduce the amount of time it takes you to get up and running with a full on, legit system that's ready to scale. That way you focus on building the project and validating the idea, and not on inconsequential things like how to structure your code/server.

Contact & Licensing

Feel free to use this for whatever you like, but don't blame me if someone loses an eye.

If you are using this, I'd love to hear about your project. It's great to know my code is being used somewhere by someone.

Leander Lee
me@leander.ca

FAQs

Package last updated on 18 May 2018

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