pine2e
raw JSON → 0.3.0 verified Fri May 01 auth: no javascript abandoned
Pinetwo's pluggable web stack for twelve-factor apps based on Express.js and PostgreSQL. Current stable version 0.3.0, under development with no regular release cadence. Designed for Heroku deployment, integrates Express 3.x, PostgreSQL, Grunt tasks, ES6 transpilation, and LESS compilation. Differentiated by its opinionated structure but lacks widespread adoption and has not been updated in years.
Common errors
error Error: Cannot find module 'grunt' ↓
cause Missing peer dependency grunt
fix
npm install grunt@~0.4.1 --save-dev
error TypeError: app.startServer is not a function ↓
cause Trying to call startServer on the pine2e module instead of the app instance
fix
Initialize app with pine2e.initializeRootApp(__dirname) then call app.startServer()
error ReferenceError: jQuery is not defined ↓
cause ES6 transpiler options missing jQuery globals
fix
Add 'jQuery': false to es6transpiler.client.options.globals in Gruntfile
Warnings
deprecated Package is abandoned: no updates since 2014, depends on deprecated Express 3.x and Grunt. ↓
fix Migrate to a modern framework like Express 4.x with separate middleware.
breaking Requires Grunt ~0.4.1 as peer dependency; modern npm may warn or fail. ↓
fix If using npm v3+, install grunt explicitly: npm install grunt@~0.4.1
gotcha Config functions must be CommonJS exports, not module.exports. ↓
fix Use exports.configureApp = function(app) {...};
gotcha ES6 transpiler tasks: files from src/ -> lib/, assets/js6/ -> assets/js/; if directories missing, tasks fail silently. ↓
fix Ensure source directories exist before running grunt.
Install
npm install pine2e yarn add pine2e pnpm add pine2e Imports
- initializeRootApp wrong
import { initializeRootApp } from 'pine2e'; // ESM not supported, CJS onlycorrectconst pine2e = require('pine2e'); module.exports = pine2e.initializeRootApp(__dirname); - configureApp / configureRootApp wrong
module.exports = { configureApp: function(app) {} }; // Must use exports, not module.exportscorrectexports.configureApp = function(app) { }; exports.configureRootApp = function(app) { }; - startServer wrong
const app = require('pine2e'); app.startServer(); // startServer is on the initialized app, not on pine2e modulecorrectrequire('./app').startServer();
Quickstart
// Initialize a new pine2e app
const pine2e = require('pine2e');
const app = pine2e.initializeRootApp(__dirname);
// Define routes
app.get('/', (req, res) => {
res.render('home');
});
// Start server (port from env or default 5000)
app.startServer();