Registry / serialization / sfc-compiler

sfc-compiler

JSON →
library0.7.6jsnpmunverified

A compiler for SFC (Single File Components) that provides rendering capabilities. Version 0.7.6 is the current stable release. Minimal documentation is available; the package is very simple with a single main export. It targets Node.js environments and uses CommonJS. There are no significant differentiators documented.

npm install sfc-compiler
INSTALL
IMPORT
SIG · SFC-COMPILER
S
sfc-compiler
serializationjavascriptv0.7.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.

createCompiler
const { createCompiler } = require('sfc-compiler');
const compiler = require('sfc-compiler');
The default export is an object with createCompiler method; direct require gives the whole module, not the compiler instance.
compiler
const compiler = require('sfc-compiler').createCompiler();
const compiler = require('sfc-compiler'); compiler.render();
Call createCompiler() to get an instance with render method.
render
const compiler = require('sfc-compiler').createCompiler(); compiler.render();
require('sfc-compiler').render();
render is a method on the compiler instance, not a direct export of the module.

Shows how to create a compiler instance and call render.

const compiler = require('sfc-compiler').createCompiler(); compiler.render();
Debug
Known issues
gotchaThe package uses CommonJS; ES6 imports may not work directly without conversion.
fix
Use require() instead of import.
affects: all
Errors
Common errors & fixes
TypeError: compiler.render is not a function
Calling require('sfc-compiler') returns the module object, not a compiler instance.
fix
Use require('sfc-compiler').createCompiler() to get the compiler instance.
Error: Cannot find module 'sfc-compiler'
Package not installed or not in node_modules.
fix
Run npm install sfc-compiler
Upgrade
Version history
0.7.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
sfc-compiler — npm install sfc-compiler · libregistry