Socket
Socket
Sign inDemoInstall

we-class-theme

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    we-class-theme

We.js theme class used to load themes


Version published
Maintainers
1
Install size
829 kB
Created

Readme

Source

we-class-theme

We.js class theme used to load one we.js theme from npm module

API

After all ... load the class

// load the class in your scripts
var Theme = require('we-class-theme');

Load one theme

// load the class in your scripts
var projectFolder = process.cwd();
var myTheme = new Theme(
  'wejs-theme-default', // this is the npm module name of your theme
  projectFolder // you need to pass the project folder where the npm_modules/wejs-theme-default npm package are instaled
);

For more infos check we.js theme engine for one example or how to use this class with sails.js, link: https://github.com/wejs/we-theme-engine/blob/master/lib/themeHook.js

Helpers

Sails Helpers avaible in theme class

render
/**
 * Render one template with variables and template
 *
 * @param  {object} req      express js request
 * @param  {object} res      express.js response
 * @param  {string} template the template name
 * @param  {object} data     data passed to template
 */
// example:
theme.render(req, res, 'home/index');

Grunt helpers and all other helpers see

Check: https://github.com/wejs/we-class-theme/blob/master/lib/index.js

Credits

Alberto Souza and contributors

License

MIT

FAQs

Last updated on 17 Feb 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc