Registry / security / stopforumspam

stopforumspam

JSON →
library1.3.9jsnpmunverified

A Node.js wrapper for the StopForumSpam.com REST API (v1.3.9). Provides promise-based and sync methods to query the StopForumSpam database for spam reports by IP, email, or username. Supports checking if a user is a spammer and submitting new reports with an API key. Uses the Q promise library. Note: only IPv4 is supported by the upstream service. The package is low-traffic and maintained on an as-needed basis by a single developer.

npm install stopforumspam
INSTALL
IMPORT
SIG · STOPFORUMSPAM
S
stopforumspam
securityjavascriptv1.3.9
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.

default
import stopforumspam from 'stopforumspam';
const stopforumspam = require('stopforumspam');
ESM import of the entire module; CommonJS require also works but is not recommended for modern code.
User
const User = stopforumspam.User;
import { User } from 'stopforumspam';
User is a property of the default export, not a named export.
Key
stopforumspam.Key('your-api-key');
import { Key } from 'stopforumspam';
Key is a method on the default export, not a named export.

Demonstrates creating a user, checking spam status via promise, submitting a report, manual query, and synchronous API.

import stopforumspam from 'stopforumspam'; // Create a user object to check const sfsUser = stopforumspam.User('127.0.0.1', 'test@test.com', 'testUserName'); // Check if reported as spammer sfsUser.isSpammer() .then(result => { if (result) { console.log('Spammer detected:', result); } else { console.log('Not a spammer'); } }) .catch(err => console.error(err)); // Submit a spam report (requires API key) stopforumspam.Key('your-api-key'); sfsUser.submit('Optional reason') .then(() => console.log('Submitted')) .catch(err => console.error('Submit failed', err)); // Manual query with specific parameters stopforumspam.isSpammer({ ip: '123.456.789.100' }) .then(result => console.log(result)); // Synchronous version const spammer = stopforumspam.isSpammerSync({ ip: '127.0.0.1', email: 'test@test.com' }); console.log(spammer);
Debug
Known issues
gotchaStopForumSpam.com only supports IPv4 addresses; IPv6 will cause errors.
fix
Ensure you only pass IPv4 addresses to the User constructor or query functions.
affects: all
deprecatedThe 'request' library used internally is deprecated and may have security issues.
fix
Consider using a fork or replacing the package if security is a concern.
affects: all
breakingThe package uses Q promises which are non-standard; errors caught via .fail() instead of .catch().
fix
Use .catch() for promise error handling, but note that Q promises also support .fail().
affects: all
gotchaThe User constructor parameters are positional: ip, email, username. Order matters.
fix
Always pass arguments in correct order: (ip, email, username).
affects: all
deprecatedThe package is not actively maintained; last release was in 2017. No TypeScript types.
fix
Consider alternatives like 'sfs-api' or implement your own API calls.
affects: all
Errors
Common errors & fixes
Error: Can't set headers after they are sent.
Multiple calls to submit or check without waiting for previous promise to resolve.
fix
Chain promises properly or use async/await to avoid concurrent requests.
TypeError: stopforumspam.User is not a function
Using named import { User } instead of default import or require.
fix
Use const stopforumspam = require('stopforumspam'); or import stopforumspam from 'stopforumspam'; then call stopforumspam.User().
ReferenceError: Q is not defined
Attempting to use Q directly without installing, or mixing promise libraries.
fix
Do not rely on Q globally; use the promises returned by the library directly.
Upgrade
Version history
1.3.9latest on npm
Audit
Dependencies
qrequiredPromise library used internally for async operations
requestrequiredHTTP client for API calls (deprecated, but still used)
Agent activity
22 hits · last 30 days
node
18
Resources
stopforumspam — npm install stopforumspam · libregistry