# infinitered/nsfwjs

NSFW detection on the client-side via TensorFlow.js

Repository: https://github.com/infinitered/nsfwjs
Canonical: https://ross.abutalabs.com/products/nsfwjs
Homepage: https://nsfwjs.com/
Language: TypeScript
License: MIT
License Family: permissive
Topics: machine-learning, machinelearning, javascript, tensorflowjs, tensorflow-js, node-module, content-management, nsfw-recognition
Last push: 2026-08-04T15:28:33+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 64, longevity 100
- inputs: {"age_days": 2758, "days_push": 29, "days_rel": 29, "gap_med": 330.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8965, forks 599 (observed 2026-08-28T04:10:26.540524+00:00)

## What it is
NSFWJS is a JavaScript library that uses TensorFlow.js to classify images into NSFW/safety categories (Drawing, Neutral, Sexy, Hentai, Porn) entirely client-side. It works in the browser, Node.js, and React Native with ~90-93% accuracy.

## Use cases
- detect nsfw images in the browser before upload
- filter inappropriate user-generated content client-side
- classify images as safe or explicit in javascript
- moderate image content in a react native app
- block adult content in a browser extension
- check image safety without sending data to a server

## When to choose
- you need privacy-preserving, client-side image moderation with no server round-trip
- you want a simple npm drop-in with TensorFlow.js and pre-trained models
- you need cross-browser, Node, or React Native support

## When to avoid
- you need server-side, GPU-accelerated high-throughput moderation at scale
- you require legally guaranteed accuracy or fine-grained policy enforcement
- you need video or text moderation, not just images

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, image-processing, computer-vision
- domain: machine-learning, image-processing, web-development, privacy
- platform: browser, cross-platform
- tags: nsfw-detection, tensorflowjs, content-moderation, client-side-ml, image-classification, nodejs, javascript

## Member repositories
- infinitered/nsfwjs (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:26.540524+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:24:26.858029+00:00, confidence not recorded.
  - readme: https://github.com/infinitered/nsfwjs (fetched 2026-08-28T04:10:26.540524+00:00, sha 9962565edc47)
  - homepage: https://nsfwjs.com/ (fetched 2026-08-29T08:24:55.816777+00:00, sha 2bda33932637)
  - registry_npm: https://registry.npmjs.org/nsfwjs (fetched 2026-08-29T08:24:55.819400+00:00, sha fe2333fe4e7e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
