Node.js

Post links to your 64bit module repos here. Repo maintainers are responsible for resolving any issues caused by their xzm's.
rych
Warlord
Warlord
Posts: 787
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Node.js

Post#1 by rych » 09 May 2025, 11:15

update_node script below updates (installs?) Node as a mountable squashfs module:

Code: Select all

#!/usr/bin/bash
# Updates a portable Node installation in the directory:
cd /I
mkdir -p Node

mount -t squashfs Node.sqfs Node
current=$(Node/bin/node -v  | tail -c+2)

URL=https://nodejs.org/dist/latest/
#Assuming e.g. https://nodejs.org/dist/latest/node-v23.11.0-linux-x64.tar.xz
FILE=$(curl -s $URL | grep -oE 'node-v[0-9.]+-linux-x64.tar.xz' | head -n 1)
latest=${FILE#*v}
latest=${latest%*-l*}

echo "$latest > $current"
if [[ $(printf '%s\n' "$current" "$latest" | sort -V | tail -n1) != "$current" ]]; then
    echo "Upgrading from $current to $latest"
    umount Node.sqfs
    wget -Nq --show-progress $URL$FILE
    tar -xf $FILE -C Node --strip-components=1
    squashfs_create Node
    rm $FILE
    rm -rf Node/*
    mount -t squashfs Node.sqfs Node
    Node/bin/node -v
fi
It relies on a tiny squashfs_create script encapsulating your favorite compression method:

Code: Select all

#!/bin/bash
#mksquashfs $1 $1.sqfs -noappend -comp zstd -b 256K -Xcompression-level 22
#mksquashfs $1 $1.sqfs -noappend -comp zstd -b 256K
mksquashfs $1 $1.sqfs -noappend -comp lz4
Node.sqfs with lz4: 70Mb, std: 40Mb; both mountable as 180Mb ./Node folder.

User avatar
Ed_P
Contributor
Contributor
Posts: 8954
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Node.js

Post#2 by Ed_P » 09 May 2025, 19:41

Are you suggesting this as a replacement for the current porteus.org server?? :D

Post Reply