HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
hapijs
joi
JavaScript2016–2018
hapijs / joi

joi

The most powerful data validation library for JS

7Distinct people
7Mentions
0Explicit recommenders
21.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The most powerful data validation library for JS

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month7 dated mentions

Observed mentions: 2016-11-18 00:13:33 UTC to 2018-08-24 17:50:49 UTC.

012016-11-01 00:00:00 UTC to 2016-12-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsNov 20162016-12-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2017-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-02-01 00:00:00 UTC to 2017-03-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2017-03-01 00:00:00 UTC to 2017-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-04-01 00:00:00 UTC to 2017-05-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-05-01 00:00:00 UTC to 2017-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-06-01 00:00:00 UTC to 2017-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-07-01 00:00:00 UTC to 2017-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-08-01 00:00:00 UTC to 2017-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-09-01 00:00:00 UTC to 2017-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsSep 20172017-10-01 00:00:00 UTC to 2017-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-11-01 00:00:00 UTC to 2017-12-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-12-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2018-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-02-01 00:00:00 UTC to 2018-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-03-01 00:00:00 UTC to 2018-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-04-01 00:00:00 UTC to 2018-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-05-01 00:00:00 UTC to 2018-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-06-01 00:00:00 UTC to 2018-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-07-01 00:00:00 UTC to 2018-08-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-08-01 00:00:00 UTC to 2018-09-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsAug 2018

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Nov 20162016-11-01 00:00:00 UTC2016-12-01 00:00:00 UTC110
Dec 20162016-12-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
Jan 20172017-01-01 00:00:00 UTC2017-02-01 00:00:00 UTC000
Feb 20172017-02-01 00:00:00 UTC2017-03-01 00:00:00 UTC110
Mar 20172017-03-01 00:00:00 UTC2017-04-01 00:00:00 UTC000
Apr 20172017-04-01 00:00:00 UTC2017-05-01 00:00:00 UTC101
May 20172017-05-01 00:00:00 UTC2017-06-01 00:00:00 UTC000
Jun 20172017-06-01 00:00:00 UTC2017-07-01 00:00:00 UTC000
Jul 20172017-07-01 00:00:00 UTC2017-08-01 00:00:00 UTC000
Aug 20172017-08-01 00:00:00 UTC2017-09-01 00:00:00 UTC000
Sep 20172017-09-01 00:00:00 UTC2017-10-01 00:00:00 UTC000
Oct 20172017-10-01 00:00:00 UTC2017-11-01 00:00:00 UTC000
Nov 20172017-11-01 00:00:00 UTC2017-12-01 00:00:00 UTC101
Dec 20172017-12-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
Jan 20182018-01-01 00:00:00 UTC2018-02-01 00:00:00 UTC000
Feb 20182018-02-01 00:00:00 UTC2018-03-01 00:00:00 UTC000
Mar 20182018-03-01 00:00:00 UTC2018-04-01 00:00:00 UTC000
Apr 20182018-04-01 00:00:00 UTC2018-05-01 00:00:00 UTC000
May 20182018-05-01 00:00:00 UTC2018-06-01 00:00:00 UTC000
Jun 20182018-06-01 00:00:00 UTC2018-07-01 00:00:00 UTC000
Jul 20182018-07-01 00:00:00 UTC2018-08-01 00:00:00 UTC101
Aug 20182018-08-01 00:00:00 UTC2018-09-01 00:00:00 UTC101

What Hacker News says

7 sources
That is in no way different than REST: 1. (same) 2. Based on the screen designs and workflows, front end dev team writes the REST contract that they want. They mock the endpoints (i.e. using nock [0] or Angular's MockBackend) for the contracts and come up with the DTO definitions. 3. Backend folks start implementing the REST endpoints by orchestrating microservices (or by creating a REST service facade for an existing REST API). 4. Once the backend REST endpoints are done, switch out the mock endpoints for the real ones There is no need or benefit for using GraphQL here, all this can be done with REST already. Tooling around REST is great, i.e. you could use TypeScript to generate .d.ts files for your REST Dtos based on the swagger API schema [1]. Or with plain JS, use a JS runtime library that validates the DTO schematics/REST contracts
Read the rest
(both your mocked ones and the real ones returned by the backend) with i.e. joi [2]. [0]: https://github.com/nock/nock [1]: https://github.com/swagger-api/swagger-codegen [2]: https://github.com/hapijs/joi
In Why use GraphQL, good and bad reasons
I really like the error messages that Joi[1] provides. You can easily use the error.message property to give a human friendly message to the end-user and if the default options don't serve your needs you can overwrite them with custom messages. Someone made a Joi playground a few months ago, Joi Tester[2], that makes it really easy to test your Joi schemas. If you're curious, feel free to give it a try (I'm not affiliated with the tool in any regards but I do think it's awesome). [1] https://github.com/hapijs/joi [2] http://framp.me/joi-tester/
In User experience design for APIs
"NoSQL means Not-injectable, right?" makes no sense for me. It doesnt matter which type of database technology you are using. As any other database there are security roles. No mongodb query should be executed as an admin. You can restrict that up to document level. You can even create read-only views. You should always validate you payload. Use e.g Joi https://github.com/hapijs/joi. Someone who doesn't validate his payload and pass it up to the driver should not be surprised.
In MongoDB will not prevent NoSQL injections in your Node.js app
askucher·Nov 18, 2016Submission

JS Real-Time Type Check System for Ocaml/F# Lowers and Other Esthetes ONLY

Hi I hate to cover my JSON controllers with Type Check System but I have to do it because of security reasons. So, I tried to trick my brain and make this process enjoyable. I would like to share the solution with you (https://github.com/askucher/ftjs). if you have same problem and it helps you that my hence my karmic task of helping people will has a little progress. There are other projects like joi already available (https://github.com/hapijs/joi) but ftjs has own Ocaml/F# like DSL and who likes Discriminated Unions, Syntax Sugar will understand me.
1 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.