Registry / database / FastLegS

FastLegS

JSON →
library0.3.4jsnpmunverified

FastLegS is a PostgreSQL ORM built on top of node-postgres, providing a lightweight Active Record-style interface for basic CRUD operations and querying. Version 0.3.4 is the latest stable release; it also supports MySQL via instantiation parameter. It uses callbacks and simple object mappings, with no built-in migrations or schema management. Compared to heavier ORMs like Sequelize, FastLegS offers minimal configuration and direct SQL control, but lacks advanced features like associations, validation, or streaming. It targets Node.js >=0.8.18 and has irregular releases.

npm install FastLegS
INSTALL
IMPORT
SIG · FASTLEGS
F
FastLegS
databasejavascriptv0.3.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FastLegSBase
var FastLegSBase = require('FastLegS');
const FastLegSBase = require('fastlegs'); // case-sensitive
Package name is case-sensitive: FastLegS, not fastlegs.
FastLegS instance
var FastLegS = new FastLegSBase('pg');
var FastLegS = FastLegSBase('pg'); // missing new
Must instantiate with 'pg' or 'mysql' using new.
Base model
var Post = FastLegS.Base.extend({ tableName: 'posts', primaryKey: 'id' });
Post = Extend({}); // incorrect usage
Use FastLegS.Base.extend() to define models.

Connects to PostgreSQL, defines a Post model, and inserts a row with a callback.

var FastLegSBase = require('FastLegS'); var FastLegS = new FastLegSBase('pg'); var connectionParams = { user: process.env.PGUSER ?? 'myuser', password: process.env.PGPASSWORD ?? '', database: process.env.PGDATABASE ?? 'mydb', host: 'localhost', port: 5432 }; FastLegS.connect(connectionParams); var Post = FastLegS.Base.extend({ tableName: 'posts', primaryKey: 'id' }); Post.create({title: 'Hello', body: 'World'}, function(err, result) { if (err) console.error(err); else console.log(result); });
Debug
Known issues
breakingIn version 0.2.0, the API changed from require('FastLegS') returning an object with static methods to requiring instantiation with new FastLegSBase('pg' or 'mysql').
fix
Use new FastLegSBase(driver) pattern, where driver is 'pg' or 'mysql'.
affects: >=0.2.0
deprecatedThe package is no longer maintained; last release was 0.3.4 in 2012.
fix
Migrate to a maintained ORM like Sequelize or Knex.
affects: <=0.3.4
gotchaFunction names may be reserved words in strict mode (e.g., 'delete') causing runtime errors.
fix
Avoid calling methods like 'delete' without explicit context; wrap in named functions.
affects: >=0.1.0
gotchaThe 'pg' dependency is not listed in package.json; must be installed separately.
fix
Run 'npm install pg' in your project.
affects: >=0.1.0
gotchaThe package name is case-sensitive; 'fastlegs' or 'Fastlegs' will not resolve.
fix
Use 'require('FastLegS')' exactly as written.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'FastLegS'
Missing npm installation or incorrect case in require path.
fix
Run 'npm install FastLegS' and require with exact case: require('FastLegS').
Error: Cannot find module 'pg'
The 'pg' peer dependency is not installed.
fix
Run 'npm install pg'.
TypeError: FastLegSBase is not a constructor
Using new FastLegSBase() without parentheses or with wrong driver string.
fix
Ensure you write 'var FastLegS = new FastLegSBase('pg');' and that FastLegSBase is the correct variable name.
Upgrade
Version history
0.3.4latest on npm
Audit
Dependencies
pgrequiredPostgreSQL client required for database operations
Agent activity
70 hits · last 30 days
node
60
Perplexity
1
OpenAI (training)
1
Resources
FastLegS — npm install FastLegS · libregistry