Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Als-build is a frontend framework for building ssr and html web pages with built in route system based on file paths.
Not for use - being tested
Als-build is a frontend framework for building ssr and html web pages with built in route system based on file paths.
Install with npm i als-build
and create:
src
folder on root folder of your projectbuild.js
with folowing example codeSyntax:
let build = new Build(
srcDirPath:string,
options={
url='':string,
minify:false,
ecmaVersion:2022:number,
prefix:'imported':string,
publicDirName='public':string,
viewsDirName='views':string,
layoutObj={}:Object
}:Object,
): instanceof Build
build.build(): instanceof Build
build.watch(): instanceof Build
Example:
let {join} = require('path')
let Build = require('als-build')
let srcDirPath = join(__dirname,'src')
new Build(srcDirPath,{url:'/public'})
.build() // for building once from src
.watch() // for building and watching for changes in src
Running build, will create two folders:
Inside src
folder, you can place any file you want and route files.
Route
files are files which has .cjs
or .html.cjs
extension and return function(layoutObj,data)
which has to return modified layoutObj
.
The layoutObj, is an instance of als-layout class which will create view file and then html file if needed.
The defaults for layoutObj
, taken from options.layoutObj
which you provided on constructor.
Also, layoutObj will include rootUrl
which is url, you have provided on constructor.
Inside route files you can require files for frontend and for backend, by setting params (back=false,front=false).
Also you can require any files you want, and if it's not js or css files, it's just will be copied to public/resources
folder.
Also you can set front=footer
for puting resource file on footer and fn=false
to use content as is and not inside function.
If route file is .html.cjs
, inside public folder will be created index.html
by repiting folder structure in src folder.
Example for route file:
require('./some.css')
require('./some.png')
let some = require('some-package?back=false')
let header = require('./layout/header?front=false')
let footer = require('./layout/footer?front=false')
let body = require('./layout/body?front=false')
module.exports = function(layoutObj,data) {
let strData = JSON.stringify(data)
layout.scripts[layout.scripts.length-1].footer=false // put last code on footer
layoutObj.scripts.push({inner:`let data = ${strData}`,footer:true})
layoutObj.header = header
layoutObj.footer = footer
layoutObj.body = body
return layoutObj
}
Example for src folder and views and public folders which has created for src folder.
You can use those parameters as query parameters inside require statement, or in imported file it self inside comments at the top of the file:
Example for usage as parameter
/**
* @front = footer
*/
if nodemon installed, adding ignore for src, view and public folder
You can add .ignore file to "view" and "public" folders with list of files to ignore. This file will allow you to add files to "public" and "view" folders which will not be cleaned up on build.
FAQs
Als-build is a frontend framework for building ssr and html web pages with built in route system based on file paths.
The npm package als-build receives a total of 0 weekly downloads. As such, als-build popularity was classified as not popular.
We found that als-build 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.