New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jalla

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jalla

web compiler and server in one

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
77
increased by54%
Maintainers
1
Weekly downloads
 
Created
Source

jalla

stability experimental npm version build status downloads js-standard-style

Jalla is an opinionated web compiler and server in one, intended for both development and production use. Jalla puts together popular tools and frameworks that makes web development fun and performant.

The stack consists of a Koa server, a Browserify bundler for scripts and PostCSS for styles. Documents are compiled using documentify. It's intended for use with Choo and heavily inspired by Bankai. In fact, if static bundling and CSS in JS is your thing, you'll probably have a better time using Bankai.

Usage

$ jalla index.js

API

Middleware can be added by creating an instance of the server. The application is an instance of Koa and supports all Koa middleware.

var jalla = require('jalla')
var app = jalla('index.js')

// enable gzip
app.use(require('koa-compress')())

app.use(function (ctx, next) {
  // only allow robots on production website
  if (ctx.path === '/robots.txt' && process.env.NODE_ENV !== 'production') {
    ctx.type = 'text/plain'
    ctx.body = `
      User-agent: *
      Disallow: /
    `
  }
  return next()
})

app.listen(8080)

Events

Most of the internal workings are exposed as events on the application (Koa) instance.

app.on('error', callback(err))

When an internal error occurs or a route could not be served. If an HTTP error was encountered, the status code is availible on the error object.

app.on('warning', callback(warning))

When a non-critical error was encountered, e.g. a postcss plugin failed to parse a rule.

app.on('progress', callback(file))

When a change is detected to an entry file and processing begins.

app.on('bundle:script', callback(file, buf))

When a script file finishes bundling.

app.on('bundle:style', callback(file, buf))

When a css file finishes bundling.

app.on('bundle:file', callback(file))

When a file is being included in a bundle.

app.on('timing', callback(time, ctx))

When a HTTP response has been sent.

app.on('start', callback(port))

When the server starts.

Todo

  • Document configuration and options
  • Document middleware
  • Document SSR
  • Document meta tags
  • Export compiled files to disc
  • Export compiled HTML to disc
  • Resolve dynamic routes on export

Keywords

FAQs

Package last updated on 12 Jun 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