Registry / web-framework / trucks-compiler

trucks-compiler

JSON →
library0.3.6jsnpmunverified

Web component compiler and package manager that compiles HTML-declared web components into separate JavaScript, CSS, and HTML files. Version 0.3.6 is the latest stable release, with infrequent updates. It uses a plugin architecture with multiple plugin types (core, protocol, transform, generator) and runs on Node.js >=4.0. Differentiators include full component tree transformation, custom plugin support, and multiple resolver protocols.

npm install trucks-compiler
INSTALL
IMPORT
SIG · TRUCKS-COMPILER
T
trucks-compiler
web-frameworkjavascriptv0.3.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

trucks
const trucks = require('trucks-compiler');
import trucks from 'trucks-compiler';
CommonJS only; no ES module support.
LOAD
const { LOAD } = require('trucks-compiler');
const LOAD = require('trucks-compiler').LOAD;
Named export via destructuring or property access.
PARSE
const { PARSE } = require('trucks-compiler');
const PARSE = 'parse';
Use the named constant to avoid string literals.

Demonstrates basic usage: compile a component HTML file with transforms and output directory.

const trucks = require('trucks-compiler'); trucks({ files: ['components.html'], transforms: ['skate'], out: 'build', force: true }, (err, state) => { if (err) { throw err; } console.log(state); });
trucks --version
Debug
Known issues
gotchaCommonJS only: package does not provide ESM exports; using ES import syntax will fail.
fix
Use require() instead of import.
affects: >=0.0.0
gotchaCallback-based API: no Promise or async/await support; errors must be handled in callback.
fix
Wrap with Promise if async/await needed.
affects: >=0.0.0
gotchaNode.js engine restriction: requires Node >=4.0; may not work on older versions.
fix
Ensure Node.js version >=4.0.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'trucks-compiler'
Package not installed.
fix
Run 'npm install trucks-compiler'.
TypeError: trucks is not a function
Incorrect import (ES import on CommonJS package).
fix
Use 'const trucks = require("trucks-compiler");'.
Upgrade
Version history
0.3.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
trucks-compiler — npm install trucks-compiler · libregistry