![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
A Fast and Easy To Use View Engine, Compiled In Go.
sudo apt-get install libpcre3-dev
npm install turbx
const express = require('express');
const {join} = require('path');
const turbx = require('turbx');
const app = express();
app.engine('xhtml', turbx({
/* global options */
template: 'layout',
opts: {default: 'some default options for res.render'},
before: function(opts){
// do stuff before res.render
},
after: function(opts, html /* html string containing the compiled output */){
// do stuff after res.render
},
}));
app.set('views', join(__dirname, 'views'));
app.set('view engine', 'md');
app.use(function(req, res, next){
res.render('index', {
title: 'example',
content: '<h2>Hello, World!</h2>',
// const vars can be used to precompile a var, and not need to compile it again
// a const var is defined by starting with a '$' in the key name
$GoogleAuthToken: 'This Value Will Never Change',
});
});
// pre compiling constant vars
app.use(async function(req, res, next){
let preCompiled = await res.inCache('index');
if(!preCompiled){
const SomethingConsistant = await someLongProcess();
await res.preRender('index', {
$myConstVar: SomethingConsistant,
});
}
res.render('index', {
title: 'example',
content: '<h2>Hello, World!</h2>',
});
});
// pre compiling and overriding the cache
app.use('/fix-cache', async function(req, res, next){
turbx.preCompile('index', {
$MyConstOpts: 'new constant option',
});
res.render('index', {
title: 'example',
content: '<h2>Hello, World!</h2>',
});
});
<!-- this is a comment -->
/* this is also a comment */
// this is an inline comment
<!-- output a variable with escaped HTML -->
{{title}}
<!-- output a variable and allow HTML -->
{{{content}}}
<!-- output a variable with a fallback -->
{{title|name|'Default Title'}}
<!-- output a variable as an attribute (this method will remove the attribute if the value is undefined) -->
<a {{href="url"}}>Link</a>
<!-- this is a shortcut if the attribute name matches the variable name -->
<a {{="href"}}>Link</a>
<!-- you can safely insert object keys (if an object is undefined, this will return blank, and will Not crash) -->
{{obj.key}}
<!-- use dot notation for array indexes -->
{{arr.0}}
<!-- use the value of the "key" var as the key of "obj" -->
{{obj[key]}}
{{obj[myVar]}}
<!-- using vars as if they were constant -->
{{$normalVal|'make this constant anyway, even if not sent as a constant'}}
<!-- functions start with an _ -->
<_if var1 & var2="'b'" | var2="'c'" | !var3 | (group & group1.test1)>
do stuff...
<_else !var1 & var2="var3" | (var3=">=3" & var3="!0")/>
do other stuff...
<_else/>
do final stuff...
</_if>
<_each myObj as="value" of="key">
{{key}}: {{value}}
</_each>
<!-- A component is imported by using a capital first letter -->
<!-- The file should also be named with a capital first letter -->
<!-- args can be passed into a component -->
<MyComponent arg1="value 1" arg2="value 2">
Some body to add to the component
</MyComponent>
<!-- component without a body -->
<MyComponent arg1="value"/>
<!-- file: MyComponent.xhtml -->
{{arg1}} - {{arg2}}
<h1>
{{{body}}}
</h1>
<!-- file: layout.xhtml -->
<html>
<head></head>
<body>
<header></header>
<main>
<!-- Insert Body -->
<Body/>
</main>
<footer>
</body>
</html>
<!-- random paragraph of lorem ipsum text -->
<_lorem/>
<!-- 2 paragraphs of lorem ipsum text -->
<_lorem 2/>
<!-- 3 sentence of lorem ipsum text with 5-10 words -->
<_lorem s 3 5 10/>
<!-- 1 word of lorem ipsum text with 5-10 letters -->
<_lorem w 1 5 10/>
<!-- embed a youtube video -->
<_json myList/>
// add basic rate limiting
// this function uses the express-device-rate-limit module made my AspieSoft
turbx.rateLimit(app, {opts /* for express-device-rate-limit module */});
// auto render views as pages
turbx.renderPages(app, {opts});
// also recognizes folders with an index.xhtml file
// ignores the components folder and tries to ignore root files named after error codes (or in an "error" folder)
FAQs
A Fast and Easy To Use View Engine, Compiled In Go
The npm package turbx receives a total of 7 weekly downloads. As such, turbx popularity was classified as not popular.
We found that turbx 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.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.