The package that says what you're thinking, but probably shouldn't say out loud.
Tired of coming up with polite ways to say "no"? Need a joke that's guaranteed to make someone groan? Want motivation but don't want to scroll through Instagram?
say-it-now is here to save the day (and your social life). A zero-dependency npm package that gives you the perfect response for every awkward situation. Because sometimes, you need a friend who's always ready with the right words.
Imagine having a friend who:
- β Always knows how to politely decline that MLM invitation
- β Has a joke ready when the conversation dies
- β Knows exactly what to say when you need motivation
- β Never runs out of ways to say "thank you" or "sorry"
That's say-it-now. Your new best friend in code form.
npm install say-it-nowThat's it. No configuration. No setup. No "please configure your environment variables" nonsense. Just install and go. We're not here to waste your time.
JavaScript/CommonJS:
const { sayItNow } = require('say-it-now');
// Need to say no? We've got 10 different ways!
console.log(sayItNow('no'));
// "Thanks, but no thanks." β¨
// Want a joke? We've got dad jokes ready!
console.log(sayItNow('joke'));
// "Why don't scientists trust atoms? Because they make up everything!" π
// Monday morning motivation?
console.log(sayItNow('motivation'));
// "You've got this!" πͺTypeScript/ES Modules:
import { sayItNow, ResponseType } from 'say-it-now';
const joke: string = sayItNow('joke');
const motivation: string = sayItNow('motivation' as ResponseType);const { sayItNowWithType, getAvailableTypes } = require('say-it-now');
// Get response with metadata (for the organized folks)
const result = sayItNowWithType({ type: 'yes' });
console.log(result);
// { type: 'yes', message: 'Yes, absolutely!' }
// See what's available (because options are nice)
const types = getAvailableTypes();
console.log(types);
// ['no', 'yes', 'maybe', 'joke', 'motivation', 'thank-you', 'apology']Don't worry if you're using the old function names - they still work! We've got your back:
const { justSayIt, justSayItWithType, saySomething, saySomethingWithType } = require('say-it-now');
// These still work (but we recommend using sayItNow)
justSayIt('joke');
justSayItWithType({ type: 'motivation' });
saySomething('joke');
saySomethingWithType({ type: 'motivation' });| Type | What It Does | When to Use |
|---|---|---|
π« no |
Polite ways to decline | When your friend asks you to join their MLM |
β
yes |
Enthusiastic affirmations | When you're feeling optimistic (rare, but it happens) |
π€· maybe |
Non-committal responses | When you want to keep your options open |
π joke |
Random jokes | When the conversation dies and you need to break the ice |
πͺ motivation |
Inspirational quotes | Monday mornings, deadlines, life in general |
π thank-you |
Gratitude expressions | When someone does something nice (remember those?) |
π apology |
Sincere apologies | When your code breaks production (again) |
Want to use this as a microservice? We've got you covered!
npm start
# or
node dist/server.js# Get a random joke (because why not?)
curl http://localhost:3000/joke
# Need motivation? We've got you!
curl http://localhost:3000/motivation
# Want JSON? Just ask nicely
curl http://localhost:3000/yes?format=json
# See what's available
curl http://localhost:3000/allGET /- API info and available types (the welcome mat)GET /all- List all response types (for the curious)GET /:type- Get a random response (plain text, because simple is good)GET /:type?format=json- Get response with metadata (for the data lovers)
PORT=8080 HOST=0.0.0.0 npm startOr programmatically:
const { startServer } = require('say-it-now/dist/server');
const server = await startServer({ port: 8080, host: '0.0.0.0' });# Get a quick response
say-it-now joke
say-it-now motivation
say-it-now no
# Want JSON? We've got you covered
say-it-now yes --json
# See what's available
say-it-now --list
# Need help? (We all do sometimes)
say-it-now --helpconst express = require('express');
const { sayItNow } = require('say-it-now');
const app = express();
app.post('/decline', (req, res) => {
const politeNo = sayItNow('no');
res.json({ message: politeNo });
});
// When someone asks you to join their MLM:
// Response: "Thanks, but no thanks." β¨const { sayItNow } = require('say-it-now');
function mondayMotivation() {
return sayItNow('motivation');
}
console.log(mondayMotivation());
// "You've got this!" πͺ
// (Coffee not included, but highly recommended)const { sayItNow } = require('say-it-now');
function apologizeForBreakingProduction() {
return sayItNow('apology');
}
console.log(apologizeForBreakingProduction());
// "I sincerely apologize." π
// (We've all been there)Returns a random response message. Defaults to 'no' (because sometimes you just need to say no).
sayItNow('joke'); // Returns a random joke
sayItNow(); // Returns a random "no" (default)Throws: Error if the type is invalid (we're helpful like that)
Returns an object with both the type and message (for when you need metadata).
sayItNowWithType({ type: 'motivation' });
// { type: 'motivation', message: 'You've got this!' }Throws: Error if the type is invalid
Note: Legacy functions justSayIt(), justSayItWithType(), saySomething(), and saySomethingWithType() are still available for backward compatibility.
Returns an array of all available response types (because knowing your options is important).
getAvailableTypes();
// ['no', 'yes', 'maybe', 'joke', 'motivation', 'thank-you', 'apology']Type guard to check if a string is a valid response type (TypeScript users, this one's for you).
isValidType('joke'); // true
isValidType('invalid'); // falseFor existing code using the old function names, these are still available:
justSayIt(type)β alias forsayItNow(type)justSayItWithType(options)β alias forsayItNowWithType(options)saySomething(type)β alias forsayItNow(type)saySomethingWithType(options)β alias forsayItNowWithType(options)JustSayItOptionsβ alias forSayItNowOptionsJustSayItResultβ alias forSayItNowResultSaySomethingOptionsβ alias forSayItNowOptionsSaySomethingResultβ alias forSayItNowResult
We recommend migrating to the new names (sayItNow and sayItNowWithType), but your existing code will continue to work.
Built with production-grade practices (because we're professionals, even if we don't act like it):
- Modular Design: Each response type lives in its own file (
src/responses/no.ts,yes.ts, etc.) - Zero Dependencies: Uses only Node.js built-in modules (no
node_modulesbloat!) - TypeScript First: Fully typed with TypeScript definitions included
- Lightweight: Small footprint, fast performance (we're not here to slow you down)
- Flexible: Use it as a library, HTTP server, or CLI tool (your choice!)
We've got comprehensive tests to make sure everything works perfectly:
# Run all core tests (41 tests)
npm test
# Run HTTP server tests
npm run test:server
# Run everything
npm run test:allTest Coverage:
- β All 7 response types
- β Function functionality and error handling
- β Type validation
- β Data integrity
- β Randomness verification
- β Edge cases
- β Backward compatibility
- β Performance benchmarks
All tests pass before publishing (thanks to prepublishOnly hook). We take quality seriously (but not ourselves).
Want to add your own responses? Go for it!
# Clone the repo
git clone https://github.com/packageengine/just-say-it.git
cd just-say-it
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Run in development mode
npm run devEach response type is in its own file. Want to add more jokes? Edit src/responses/joke.ts. Want more ways to say no? Edit src/responses/no.ts. It's that simple.
After editing, rebuild:
npm run buildQ: Why would I need this?
A: Because sometimes you need a random joke, a polite "no", or motivation at 3 AM. We've all been there. Don't judge.
Q: Is this serious?
A: Yes and no. It's a real, functional package that works perfectly. But we don't take ourselves too seriously. Life's too short for that.
Q: Can I add my own responses?
A: Absolutely! Each response type is in its own file. Just edit src/responses/[type].ts and rebuild. We believe in customization.
Q: Why zero dependencies?
A: Because we believe in keeping things simple. No bloat, no drama, just pure functionality. Your node_modules folder will thank you.
Q: What's the best response type?
A: Trick question! They're all equally amazing. But if we had to pick... joke. Always joke. Laughter is the best medicine (and we're not doctors, so don't quote us on that).
Q: Can I use this in production?
A: Absolutely! It's built with production-grade practices. Just remember: with great power comes great responsibility (and great jokes).
Q: Is it tested?
A: You bet! We have 41+ comprehensive tests covering everything from basic functionality to edge cases. Run npm test to see for yourself.
MIT License - because sharing is caring, and we care about your freedom to use this however you want. Go wild. (But responsibly, please.)
Found a typo? Want to add more responses? Have a better joke? We'd love your help!
Just remember: keep it clean, keep it fun, and keep it simple. We're here to make people smile, not to complicate their lives.
If this package made you smile (or at least didn't make you cry), consider giving it a star. It makes us feel warm and fuzzy inside.
Made with β€οΈ and a healthy dose of humor
Because the world needs more random jokes and polite "no"s.
P.S. - If you're reading this, you're awesome. Keep being awesome. And remember: sometimes the best response is just saying something.