NPM Alternative (WIP)

Overview

FNPM (WIP)

FNPM is an "alternative" for NPM, it is faster and saves more space.

DISCLAIMER ๐Ÿšง

This project was made to learn more about Package Managers, for now you should only use it to play with it.

Requirements

  • Node v16 or higher
  • Linux or Mac OS (Working on Windows support issue)

CLI

The FNPM CLI is used to install packages from the package.json of a project.

Its advantages are that it is faster than NPM and saves more space.

Instalation

npm i @fnpm-io/cli -g

Commands

  • fnpm install [pkg (optional), flags] Installs packages
  • fnpm run <script> <params> Run script from package.json
  • fnpm create <template> <arguments> Create a project from a template (Similar to npm init)
  • fnpm benchmark Tests SNPM against NPM and PNPM
  • fnpm clear Remove .snpm-cache folder
  • fnpm ls <pkg> Show versions installed by SNPM

Todo

  • Make it work in some JS Frameworks (Follow progress here)
  • Fix monorepos integration (WIP, degradated performance in some repos)

Why is it faster?

SNPM uses the same installation system as PNPM, fetch dependency, download dependency. Without waiting for the rest of the dependencies.

Now you are probably wondering how that makes the space more efficient than in NPM.

Each dependency is a hard link to a common store inside .fnpm-cache, so all your projects use shared dependencies.

It works?

Short answer, probably no, but in some cases it works. (For now)

I've selected some quickstart templates to test SNPM, and I'm working on make it work in all of them.

If you want to test a template, you can use Next or Vite, I've already tested them and it should work.

(If you want to test a template and it doesn't work, please open an issue)

Benchmarks

Nextjs - TS

This example is generated using npx create-next-app --use-npm --ts

WARNING: It works now, but some errors may appear.

  Node.js: v18.4.0
  OS: linux
  FNPM version: 0.4.0
  Current project: fnpm-next-test (0.1.0)


โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ (index) โ”‚                    name                    โ”‚   time   โ”‚ group โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    0    โ”‚ 'Bun install (with cache / with lockfile)' โ”‚ '0.17s'  โ”‚   3   โ”‚
โ”‚    1    โ”‚  'Bun install (with cache / no lockfile)'  โ”‚ '3.83s'  โ”‚   2   โ”‚
โ”‚    2    โ”‚        'FNPM install (with cache)'         โ”‚ '4.41s'  โ”‚   3   โ”‚
โ”‚    3    โ”‚        'PNPM install (with cache)'         โ”‚ '4.66s'  โ”‚   3   โ”‚
โ”‚    4    โ”‚        'YARN install (with cache)'         โ”‚ '5.56s'  โ”‚   3   โ”‚
โ”‚    5    โ”‚ 'NPM install (with cache / with lockfile)' โ”‚ '7.01s'  โ”‚   3   โ”‚
โ”‚    6    โ”‚  'NPM install (with cache / no lockfile)'  โ”‚ '8.30s'  โ”‚   2   โ”‚
โ”‚    7    โ”‚   'Bun install (no cache / no lockfile)'   โ”‚ '8.85s'  โ”‚   1   โ”‚
โ”‚    8    โ”‚    'YARN install (with cache, no lock)'    โ”‚ '10.57s' โ”‚   2   โ”‚
โ”‚    9    โ”‚         'FNPM install (no cache)'          โ”‚ '19.59s' โ”‚   1   โ”‚
โ”‚   10    โ”‚   'NPM install (no cache / no lockfile)'   โ”‚ '25.20s' โ”‚   1   โ”‚
โ”‚   11    โ”‚   'YARN install (no cache, no lockfile)'   โ”‚ '30.00s' โ”‚   1   โ”‚
โ”‚   12    โ”‚         'PNPM install (no cache)'          โ”‚ '45.77s' โ”‚   1   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The commands with no-cache executes npm cache clean -f to delete NPM Cache files (SNPM uses them too npm/pacote) and also deletes the store folder for FNPM.

Comments
  • Can't install `fastify-zod`

    Can't install `fastify-zod`

    Provide installed version

    [Ultra] v0.7.3 (47.05ms)

    Current platform

    Windows

    Describe the Bug

    I tried running the following command

    ultra install fastify-zod
    

    And it did not install the fastify-zod package. Whereas npm successfully did it.

    This is the error ultra gave to me (after 26 seconds) image

    This is what NPM shows after installation (after 5 seconds) image

    Expected Behavior

    Expected that fastify-zod gets installed automatically

    Template command (if applicable)

    ultra install fastify-zod

    To Reproduce

    Run ultra install fastify-zod in a blank project

    bug Windows 
    opened by max-programming 8
  • Errors while installing T3 packages

    Errors while installing T3 packages

    Provide installed version

    [Ultra] v0.7.6

    Provide Node.js version

    16.17.1

    Current platform

    Windows

    Describe the Bug

    I got these weird error logs while trying to install with ultra i after running ultra create t3-app

    โ„น Using https://registry.npmjs.org/ as registry...
    โšก Installed local packages in 0.15 ms!
    โœ– Error while installing globals@^13.15.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\globals\13.17.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\globals\13.17.0\package.json'
    โœ– Error extracting C:\Users\Admin\AppData\Local\Temp\ultra_tmp\ignore-b50a0b7a023c81aa1a217fb5dca7ff67.tgz to C:\Users\Admin\.ultra-cache\ignore\5.2.0: TAR_BAD_ARCHIVE: Unrecognized archive format
    โœ– Error while installing @eslint/eslintrc@^1.3.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json'
    โœ– Error extracting C:\Users\Admin\AppData\Local\Temp\ultra_tmp\path-exists-7c15fc7e9a3b16862093ccba6ad29a03.tgz to C:\Users\Admin\.ultra-cache\path-exists\4.0.0: TAR_BAD_ARCHIVE: Unrecognized archive format
    โœ– Error while installing find-up@^5.0.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\path-exists\4.0.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\path-exists\4.0.0\package.json'
    โœ– Error while installing globals@^13.15.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\globals\13.17.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\globals\13.17.0\package.json'
    โœ– Error extracting C:\Users\Admin\AppData\Local\Temp\ultra_tmp\read-cache-7a65d6fcfaf1ca051c995b784c6eb1f7.tgz to C:\Users\Admin\.ultra-cache\read-cache\1.0.0: TAR_BAD_ARCHIVE: Unrecognized archive format
    โœ– Error while installing postcss-import@^14.1.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\read-cache\1.0.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\read-cache\1.0.0\package.json'
    โœ– Error while installing ignore@^5.2.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json'
    โœ– Error while installing ignore@^5.2.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json'
    โœ– Error extracting C:\Users\Admin\AppData\Local\Temp\ultra_tmp\levn-5f3062071eebdde1684e0090ae90e913.tgz to C:\Users\Admin\.ultra-cache\levn\0.4.1: TAR_BAD_ARCHIVE: Unrecognized archive format
    โœ– Error while installing [email protected] from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\levn\0.4.1\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\levn\0.4.1\package.json'
    โœ– Error while installing ignore@^5.2.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json'
    โœ– Error extracting C:\Users\Admin\AppData\Local\Temp\ultra_tmp\regexpp-850ab2db51deef81dcd32b6851513535.tgz to C:\Users\Admin\.ultra-cache\regexpp\3.2.0: TAR_BAD_ARCHIVE: Unrecognized archive format
    โœ– [ERR] @typescript-eslint/eslint-plugin@^5.33.0 - Error reading package.json from C:\Users\Admin\.ultra-cache\regexpp\3.2.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\regexpp\3.2.0\package.json'
    โœ– Error while installing globals@^13.15.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\globals\13.17.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\globals\13.17.0\package.json'
    โœ– Error while installing ignore@^5.2.0 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\ignore\5.2.0\package.json'
    โœ– Error while installing levn@^0.4.1 from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\levn\0.4.1\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\levn\0.4.1\package.json'
    โœ– Error extracting C:\Users\Admin\AppData\Local\Temp\ultra_tmp\lodash.merge-879fb9805f7a2dc7d3dd9b949be2071a.tgz to C:\Users\Admin\.ultra-cache\lodash.merge\4.6.2: TAR_BAD_ARCHIVE: Unrecognized archive format
    โœ– Error while installing [email protected] from cache - Error reading package.json from C:\Users\Admin\.ultra-cache\lodash.merge\4.6.2\package.json - ENOENT: no such file or directory, open 'C:\Users\Admin\.ultra-cache\lodash.merge\4.6.2\package.json'
    โšก Installed packages in 3 min!
    โšก 1 Post Install scripts completed in 62.28 ms!
    โšก 121 packages verified
    โšก Done in 3 min!
    

    Expected Behavior

    It should install those packages without any errors

    Template command (if applicable)

    ๐Ÿ‘‡

    To Reproduce

    1. Run ultra create t3-app
    2. Say no to install packages
    3. Install the packages manually with ultra i
    bug 
    opened by max-programming 7
  • Create T3/Next App does not work on Windows

    Create T3/Next App does not work on Windows

    Provide installed version

    [Ultra] v0.7.5 (61.98ms)

    Current platform

    Windows

    Describe the Bug

    When I run ultra create t3-app, it fails

    image

    Expected Behavior

    It should generate a T3 Stack app just like npx creat-t3-app or yarn create t3-app

    Template command (if applicable)

    ultra create t3-app

    To Reproduce

    ultra create t3-app

    bug 
    opened by max-programming 6
  • Fixed 'remove' command exception

    Fixed 'remove' command exception

    Hi! I found a bug in the stable version of Ultra, when using "ultra remove package-name" it throws an exception if not found in peerDependencies.

    [Ultra] v0.7.0 (83.54ms)
    file:///C:/Users/doiska/Documents/Tools/nvm/v16.16.0/node_modules/ultra-pkg/build/commands/remove.js:15
            delete pkg.peerDependencies[arg];
                                        ^
    
    TypeError: Cannot convert undefined or null to object
        at remove (file:///C:/Users/doiska/Documents/Tools/nvm/v16.16.0/node_modules/ultra-pkg/build/commands/remove.js:15:37)
        at commands (file:///C:/Users/doiska/Documents/Tools/nvm/v16.16.0/node_modules/ultra-pkg/build/commands/index.js:107:16)
    
    
    opened by doiska 3
  • Support to private packages

    Support to private packages

    Ultra gives an 404 error when trying to install a private github package, seems that .npmrc file is ignored by ultra. On yarn and npm works fine.

    Versions

    • Ultra: 0.7.0
    • Node: v16.15.0
    enhancement 
    opened by luishrodg 3
  • Compare installed versions of packages.

    Compare installed versions of packages.

    Looks like this problem is related to duplicated dependencies with different versions.

    • [ ] Compare installed versions and skip if the package is suitable.
    • [ ] Cache manifests to speed up fetching.

    Originally posted by @nachoaldamav in https://github.com/nachoaldamav/fnpm/issues/38#issuecomment-1245398916

    enhancement 
    opened by nachoaldamav 3
  • Error: EXDEV: cross-device link not permitted,

    Error: EXDEV: cross-device link not permitted,

    Provide installed version

    [Ultra] v0.7.0

    Current platform

    Windows, WSL (Ubuntu 22.04 LTS)

    Describe the Bug

    My old project is up and running on an other hard disk partition

    • Run ultra clear to clean up
    โœ” Cleared cache!
    โœ” Cleared node_modules!
    โœ” Cleared all packages!
    
    • Run ultra install
    [Ultra] v0.7.0 (448.52ms)
    โ„น Using https://registry.npmjs.org/ as registry...
    โšก Installed local packages in 0.20 ms!
    โœ– Error: EXDEV: cross-device link not permitted, link '/root/.ultra-cache/@nestjs/config/2.2.0/.ultra' -> '/mnt/e/project/api/node_modules/@nestjs/config/.ultra' (file: /root/.ultra-cache/@nestjs/config/2.2.0/.ultra, target: /mnt/e/project/api/node_modules/@nestjs/config/.ultra)
    โœ– Error: EXDEV: cross-device link not permitted, link '/root/.ultra-cache/@nestjs/config/2.2.0/.vscode/settings.json' -> '/mnt/e/project/api/node_modules/@nestjs/config/.vscode/settings.json' (file: /root/.ultra-cache/@nestjs/config/2.2.0/.vscode/settings.json, target: /mnt/e/project/api/node_modules/@nestjs/config/.vscode/settings.json)
    โœ– Error: EXDEV: cross-device link not permitted, link '/root/.ultra-cache/@nestjs/config/2.2.0/LICENSE' -> '/mnt/e/project/api/node_modules/@nestjs/config/LICENSE' (file: /root/.ultra-cache/@nestjs/config/2.2.0/LICENSE, target: /mnt/e/project/api/node_modules/@nestjs/config/LICENSE)
    โœ– Error: EXDEV: cross-device link not permitted, link '/root/.ultra-cache/@nestjs/config/2.2.0/README.md' -> '/mnt/e/project/api/node_modules/@nestjs/config/README.md' (file: /root/.ultra-cache/@nestjs/config/2.2.0/README.md, target: /mnt/e/project/api/node_modules/@nestjs/config/README.md)
    

    Expected Behavior

    Fix this solution for cross device.

    Template command (if applicable)

    No response

    To Reproduce

    • Create nestjs app on device E:
    • Run ultra install
    bug 
    opened by nhahv 2
Releases(v0.8.7)
NPMJS Alternative (WIP)

SNPM (WIP) SNPM is an "alternative" for NPM, but it's not meant to replace NPM/Yarn/PNPM DISCLAIMER ?? This project was made to learn more about Packa

Nacho Aldama 534 Dec 31, 2022
๐Ÿง [WIP] Genshin Impact Chat Bot

Genshin Bot Config $ cp config/bot.sample.ts config/bot.ts Development $ yarn $ yarn dev $ open http://localhost:7001/ Npm Scripts Use yarn lint to ch

CanisMinor 2 Dec 20, 2021
[WIP] WebGL API implementation for Deno, built on GLFW using FFI.

Note I'm no longer working on this project because I have just realized macOS does not support OpenGL ES API, and adding Desktop GL backend to this mo

DjDeveloper 14 Jun 11, 2022
[WIP] A solid directive for adding colorful shadows to images.

solid-cosha A solid directive for adding colorful shadows to images (based on cosha). Quick start Install it: yarn add solid-cosha Use it: import { co

Robert Soriano 2 Feb 3, 2022
๐Ÿ“ [WIP] Write your reports in markdown, and get them in docx.

md-report What's md-report The repo name md-report stands for both "Write your reports in markdown, and get them in docx." and "Made report again." ("

Yiyang Sun 8 Jun 12, 2022
A programming language (WIP)

Umo programming language Concept Effect system (not implemented) Subtyping (not implemented) Opt-in shared mutability (not implemented) Gradual typing

Masaki Hara 15 Feb 25, 2022
WIP : Un pictionary mais avec 15 trait droits (sans courbes)

TODO Signer l'ID Ban dรจs le lobby Limiter la taille des pseudos Joueur dรฉconnectรฉ avec une couleur Afficher un message en cas de kick Limiter les devi

Jonathan 11 Apr 25, 2022
Minimal framework for SSG (WIP, PoC)

Frostleaf https://zenn.dev/0918nobita/scraps/64a268583b8463 Development Install tools asdf plugin-add nodejs asdf plugin-add pnpm asdf install Install

0918nobita 7 Jun 4, 2022
WIP: Hevm based debugger for hardhat-huff projects

Huff Debug An easy hevm debug integration for hardhat-huff projects What does it do: Speed up your development experience by gaining rich feedback in

Huff 6 Jul 15, 2022
๐Ÿ–ผ๏ธ Bringing Material Design 3 to the Astro Blog. [WIP]

??๏ธ Gumori You [WIP] Bringing Material Design 3 to the Astro Blog. ?? Contributing If you're interested in contributing to Gumori You, pls read the fo

!mportantImport 4 Oct 16, 2022
๐Ÿšง WIP: Bartosz Milewski's "Category Theory for Programmers" Korean translation ๐Ÿ“š

ํ”„๋กœ๊ทธ๋ž˜๋จธ๋ฅผ ์œ„ํ•œ ๋ฒ”์ฃผ๋ก  ๋ณธ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ๋Š” Bartosz Milewsk์˜ Category Theory for Programmers์„ ๋ฒˆ์—ญํ•˜๋ฉฐ ํ•™์Šตํ•œ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์ž…๋‹ˆ๋‹ค. ?? ๋ชฉ์ฐจ Part 1. ๋ฒ”์ฃผ:ํ•ฉ์„ฑ์˜ ๋ณธ์งˆ ํƒ€์ž…๊ณผ ํ•จ์ˆ˜ ํฌ๊ณ  ์ž‘์€ ๋ฒ”์ฃผ Kleisli Categories

Minsu Kim 22 Aug 18, 2022
WIP: Power-pack for Turbo Streams

TurboPower turbo_power is a power-pack for Turbo Streams. It provides Turbo Streams with a bunch of new actions and additionally adds the morph action

Marco Roth 123 Jan 4, 2023
(WIP) A GitHub action that backs up your repo's source code to IPFS.

repo-backup-ipfs A GitHub Action that backs up your repository's source code to IPFS. How to use Create a workflow file in your repository at .github/

Dhaiwat Pandya 4 Oct 9, 2022
[WIP] n8n nodes that cover the Zoho "Books" API

n8n-nodes-starter This repo contains example nodes to help you get started building your own custom integrations for n8n. It includes the node linter

Vrishin Patel 6 Nov 26, 2022
WIP - Boilerplate for Node.js + TypeScript + Prisma + Serverless

Boilerplate Node.js + TypeScript for Serverless WIP - Boilerplate Node.js + TypeScript + Prisma + Serverless Setup Update project information In serve

Fernando Daciuk 18 Oct 16, 2022
(WIP) A GitHub action that backs up your repo's source code to Arweave.

repo-backup-arweave A GitHub action that backs up your repo's source code to Arweave. How to use Create a workflow file in your repository at .github/

Dhaiwat Pandya 9 Sep 11, 2022
(WIP) Bilibili-live danmu listener with type.

blive-message-listener Bilibili-live danmu listener with type. Bilibili ็›ดๆ’ญ้—ดๅผนๅน•็›‘ๅฌๅ™จ๏ผŒๆ”ฏๆŒ็ฑปๅž‹่พ“ๅ‡บใ€‚ Features ๅฎŒๆ•ด็š„็ฑปๅž‹ๆ”ฏๆŒ Install npm i blive-message-listener Usage

Diu 23 Dec 28, 2022
(WIP) Bilibili-live danmu listener with type.

blive-message-listener Bilibili-live danmu listener with type. Bilibili ็›ดๆ’ญ้—ดๅผนๅน•็›‘ๅฌๅ™จ๏ผŒๆ”ฏๆŒ็ฑปๅž‹่พ“ๅ‡บใ€‚ Features ๅฎŒๆ•ด็š„็ฑปๅž‹ๆ”ฏๆŒ Install npm i blive-message-listener Usage

Diu 4 Sep 22, 2022
[WIP] A micro content management system

T8 CMS T8 is a minimal CMS for static sites and blogs. Tech Stack ReactJS TypeScript Material UI Styled Components Supabase(BaaS) Project Folder Struc

null 7 Oct 15, 2022