100 curated investment principles from Buffett, Munger, Graham, Lynch & more — ready to use in your code.
Curated by KeepRule.com — the investment principles encyclopedia.
npm install keepruleconst keeprule = require('keeprule');
// Get a random principle
const principle = keeprule.getRandom();
console.log(`"${principle.text}" — ${principle.author}`);
// Get all principles by Warren Buffett
const buffett = keeprule.getByAuthor('Buffett');
console.log(`${buffett.length} principles from Buffett`);
// Search for "margin of safety"
const results = keeprule.search('margin of safety');
results.forEach(r => console.log(r.text));Returns a random investment principle.
const p = keeprule.getRandom();
// {
// id: 3,
// text: "Price is what you pay. Value is what you get.",
// author: "Warren Buffett",
// category: "Value Investing",
// source: "Berkshire Hathaway Shareholder Letter, 2008"
// }Returns multiple random non-repeating principles.
const principles = keeprule.getRandomMultiple(5);
// Returns 5 random principlesFilter principles by author name (case-insensitive partial match).
keeprule.getByAuthor('Munger'); // All Charlie Munger principles
keeprule.getByAuthor('Graham'); // All Benjamin Graham principles
keeprule.getByAuthor('Lynch'); // All Peter Lynch principlesFilter principles by category (case-insensitive partial match).
keeprule.getByCategory('Risk Management');
keeprule.getByCategory('Value Investing');
keeprule.getByCategory('Mental Models');Full-text search across text, author, category, and source.
keeprule.search('compound'); // Principles mentioning compound interest
keeprule.search('fear'); // Principles about fear/greed
keeprule.search('intelligent'); // The Intelligent Investor referencesReturns all 100 principles.
const all = keeprule.getAll();
console.log(`Total: ${all.length} principles`);Returns a sorted list of all unique author names.
keeprule.getAuthors();
// ["Albert Einstein", "Alexander Elder", "Benjamin Graham", "Charlie Munger", ...]Returns a sorted list of all unique categories.
keeprule.getCategories();
// ["Behavioral Finance", "Business Quality", "Circle of Competence", ...]Get a specific principle by its ID (1-100).
const p = keeprule.getById(1);
// Rule No. 1: Never lose money...Returns the total number of principles.
keeprule.count(); // 100Each principle object has:
| Field | Type | Description |
|---|---|---|
id |
number | Unique identifier (1-100) |
text |
string | The investment principle or quote |
author |
string | Author name |
category |
string | Category classification |
source |
string | Source reference |
- Value Investing — Core value investing principles
- Risk Management — Managing and understanding risk
- Market Psychology — Understanding market behavior
- Long-term Investing — Patience and compound growth
- Mental Models — Thinking frameworks
- Behavioral Finance — Psychology of investing
- Circle of Competence — Knowing your limits
- Decision Making — Better investment decisions
- Business Quality — Evaluating businesses
- Financial Discipline — Spending, saving, discipline
- Portfolio Management — Diversification and allocation
- Research — Due diligence and analysis
- Warren Buffett — The Oracle of Omaha
- Charlie Munger — Berkshire Hathaway Vice Chairman
- Benjamin Graham — Father of Value Investing
- Peter Lynch — Legendary Fidelity fund manager
- John Templeton — Global investing pioneer
- John Bogle — Vanguard founder, index fund advocate
- Jesse Livermore — Legendary stock trader
- Philip Fisher — Growth investing pioneer
- George Soros — Quantum Fund founder
- Daily principle bot — Display a random principle every day
- Financial apps — Enrich your app with curated wisdom
- CLI tools — Show investing tips in terminal
- Education — Teach investment principles programmatically
- Screensavers / wallpapers — Dynamic investing quotes
Full TypeScript definitions are included:
import { getRandom, getByAuthor, Principle } from 'keeprule';
const p: Principle = getRandom();
const buffett: Principle[] = getByAuthor('Buffett');Visit KeepRule.com for:
- Interactive investment principle scenarios
- Deep-dive explanations with real-world examples
- AI-powered investment principle analysis
- Community discussions and notes
MIT - see LICENSE
Issues and PRs welcome at GitHub.
- Investor Personality Quiz - Which legendary investor are you?
- Investment Scorecard - Rate any stock like Buffett
- Portfolio Health Check - Grade your portfolio
- Fear & Greed Calculator - Market sentiment tool
- Decision Tree - Buy/Hold/Sell guidance
- Investment Calculators - Compound interest, retirement, DCA & more
- 30-Day Challenge - Transform your investing
- Free API - 100 principles, 20 authors
- NPM Package -
npm install keeprule - PyPI Package -
pip install keeprule - Chrome Extension
- Discord Bot
- Embeddable Widget
- Master Guides - Buffett, Munger, Graham & more
- Free Ebook - 100 Investment Principles
- Email Course - 7-day Buffett course
- Infographics - Visual investing guides
- Investment Glossary - 100 terms every investor should know
- Annual Report - State of Investment Principles 2026
- SEO Blog - Deep-dive investing articles
- Platform Comparisons - KeepRule vs alternatives
Built by William Wang | All Tools