Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
fig-compiler
Advanced tools
fig.js component compiler
obj = compiler(input[, opts])
Where input
is a string a of fig component. Available options for the opts
object are as follows:
opts.filePath
- required if you want to use pug's relative includes/extends inside of the componentopts.defaultName
- name set for the component, if the label
is missing on the componentopts.debug
- if set to true
passes debug
and compileDebug
to pug, tldr: if false
output is smaller, at the cost of some pretty error messagesReturns an obj
which has a few properties:
obj.template
- a function compiled by pug that takes a locals object and spits out HTML when asked toobj.style
- just a string containing the contents of the style tag inside the componentobj.script
- string of code which just so happens to be ran through babel
with the es-2015
preset for your dearest convenience.obj.name
- name of the component, taken from the label
tag, or opts.defaultName
if that doesn't exist. Otherwise undefined
For development pleasure, this module includes a simple connect middleware function, compatible with express. Used akin to express.static
middleware, point it to the directory you store your fig components in, the middleware should compile the component on the fly (without caching) and serve it to the client.
:warning: Not meant to be used in production.
// server.js
const express = require('express')
const fig = require('fig-compiler/connect')
const app = express()
app.use(fig('components'))
app.listen(3000)
// client.js
const app = fig()
app.use('main-view.fig') // pulls from localhost:3000/main-view.fig
app._components.get('main-view') // should be the compiled component
npm install fig-compiler --save
MIT
FAQs
fig.js component compiler
The npm package fig-compiler receives a total of 0 weekly downloads. As such, fig-compiler popularity was classified as not popular.
We found that fig-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.