hapikachu

Asset management for Hapi

npm install hapikachu
2 downloads in the last week
5 downloads in the last month

hapikachu

Asset management for Hapi

Getting Started

Install hapi18n by either running npm install hapi18n in your sites working directory or add 'hapi18n' to the dependencies section of the 'package.json' file and run npm install.

Required permissions

hapi18n require route permissions to be granted on the server.

What you get

In your route handlers :

handler: function () {
  this.assets.addJavascript(
    "alert('Hello world!');", 'inline'
  );
}

In your templates :

  <%- assets.css %>
  <%- assets.js %>

Available options

hapikachu: {
  basePath: '/path/to/my/js/and/css/files',
  assets: {
    js: [
      '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js',
      '/public/js/vendor/jquery-ui-1.10.3.custom.min.js',
      '/public/js/vendor/bootstrap.min.js',
      '/public/js/custom/main.js'
    ],
    css: [
      {
        type: 'less',
        path:  '/less/',
        file: 'main.less'
      }
    ]
  }
}
npm loves you