{"id":27002,"library":"folib","title":"FOlib","description":"FOlib provides TypeScript bindings for Fallout 2 engine scripting (sfall/TSSL). Current version 0.4.1, under active development with headers added on demand. Key differentiator: enables type-safe scripting for Fallout 2 mods using TSSL transpiler. Unlike raw JavaScript, provides declarations, definitions, and helper functions for sfall hooks, game APIs, and common patterns. Integrates with ESLint and TypeScript ESLint for linting.","status":"active","version":"0.4.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","Fallout","Fallout 2","sfall","TSSL"],"install":[{"cmd":"npm install folib","lang":"bash","label":"npm"},{"cmd":"yarn add folib","lang":"bash","label":"yarn"},{"cmd":"pnpm add folib","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for linting configuration","package":"eslint","optional":true},{"reason":"peer dependency for unused import detection","package":"eslint-plugin-unused-imports","optional":true},{"reason":"peer dependency for TypeScript ESLint rules","package":"typescript-eslint","optional":true}],"imports":[{"note":"fo is a named export, not default.","wrong":"import fo from 'folib'","symbol":"fo","correct":"import { fo } from 'folib'"},{"note":"ESM-only; no CommonJS support.","wrong":"const Game = require('folib').Game","symbol":"Game","correct":"import { Game } from 'folib'"},{"note":"Use type-only imports for interfaces and type aliases.","symbol":"types","correct":"import type { Critter, Item } from 'folib'"},{"note":"Subpath imports not supported; all exports are from root.","wrong":"import { sfall } from 'folib/sfall'","symbol":"sfall","correct":"import { sfall } from 'folib'"}],"quickstart":{"code":"import { fo, Game, sfall } from 'folib';\nimport { critter, item } from 'folib/types';\n\nconst player = Game.getPlayer();\nif (player) {\n  fo.printf('Player name: %s', player.name);\n  const inv = player.getInventory();\n  inv.forEach(i => sfall.setItemFlag(i, 'no_drop', true));\n}","lang":"typescript","description":"Imports core exports, fetches the player, prints name, and modifies inventory items using sfall flag."},"warnings":[{"fix":"Replace fo_version with fo.version.","message":"export const fo_version = '0.4.0' - use fo.version instead.","severity":"deprecated","affected_versions":">=0.4.0 <0.5.0"},{"fix":"Use named import: `import { fo } from 'folib'`.","message":"Removed default export in v0.4.0. `import fo from 'folib'` no longer works.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Install peer deps: `npm install --save-dev eslint eslint-plugin-unused-imports typescript-eslint`","message":"ESLint peer deps are not automatically installed; linting requires manual setup.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Replace `sfall.registerHook(...)` with `sfall.addHook(...)`.","message":"API function `sfall.registerHook` was removed; use `sfall.addHook` instead.","severity":"breaking","affected_versions":">=0.4.0"}],"env_vars":null,"search_vec":"'0.4.1':14 '2':8,32,65 'activ':16 'ad':20 'api':50 'bind':5 'common':52 'current':12 'declar':41 'definit':42 'demand':22 'develop':17 'differenti':24 'enabl':25 'engin':9 'eslint':56,59 'fallout':7,31,63,64 'folib':1,2 'function':45 'game':49 'header':19 'helper':44 'hook':48 'integr':54 'javascript':39,62 'key':23 'lint':61 'mod':33 'pattern':53 'provid':3,40 'raw':38 'safe':28 'script':10,29 'sfall':47,66 'sfall/tssl':11 'transpil':36 'tssl':35,67 'type':27 'type-saf':26 'typescript':4,58 'unlik':37 'use':34 'version':13","created_at":"2026-05-01T17:44:00.104685+00:00","updated_at":"2026-05-01T17:44:00.104685+00:00","problems":[{"fix":"Run `npm install folib` and ensure `tsconfig.json` includes `node_modules` in module resolution.","cause":"Missing npm install or incorrect module resolution.","error":"Cannot find module 'folib' or its corresponding type declarations."},{"fix":"Use named import: `import { fo } from 'folib'`.","cause":"Attempting default import after v0.4.0.","error":"Module '\"folib\"' has no exported member 'fo'."},{"fix":"Check for null/undefined: `const player = Game.getPlayer(); if (player) ...`","cause":"Assuming Game.getPlayer() always returns a valid object.","error":"TypeError: Cannot read properties of undefined (reading 'name')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/folib","openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}