Skip to content

Atomify your js - use js and handlebars templates from node modules on the front end.

Notifications You must be signed in to change notification settings

bclinkinbeard/atomify-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

atomify-js

Atomify your js - use js and handlebars templates from node modules on the front end.

Description

You want to use node modules with handlebars tempaltes and inlined fs calls on the front-end. Atomify-js helps you do that.

Method

atomify-js takes an opts object and a callback.

The opts object must contain an entry key that is the path to the entry file for atomify.

The callback will be called with an (optional) error as it's first argument and atomified source.

Examples

index.js

var js = require('atomify-js')

var opts = {
  entry: './entry.js'
, shim: {
    jquery: { path: './jquery.js', exports: '$' }
  }
, debug: true // default: `false`
}

js(opts, function (err, src) {
  
  // do something with the src
  
})

entry.js

var module = require('module')
  , template = require('template.html.hbs')
  
template({param: 'param'})

Install

Installing via npm is easy:

npm install atomify-js

About

Atomify your js - use js and handlebars templates from node modules on the front end.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%