{"id":25274747,"url":"https://github.com/juliomatcom/empty-value","last_synced_at":"2025-10-27T12:30:47.514Z","repository":{"id":57224971,"uuid":"55986032","full_name":"juliomatcom/empty-value","owner":"juliomatcom","description":":package: Check if a given value is empty in JS extending his \"truthy\" and \"falsy\" nature","archived":false,"fork":false,"pushed_at":"2016-12-13T14:10:10.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T16:02:09.563Z","etag":null,"topics":["empty","falsy","javascript","javascript-array","javascript-objects","truthy","value"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliomatcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-11T15:48:50.000Z","updated_at":"2023-03-04T04:27:27.000Z","dependencies_parsed_at":"2022-08-24T10:40:12.692Z","dependency_job_id":null,"html_url":"https://github.com/juliomatcom/empty-value","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliomatcom%2Fempty-value","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliomatcom%2Fempty-value/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliomatcom%2Fempty-value/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliomatcom%2Fempty-value/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliomatcom","download_url":"https://codeload.github.com/juliomatcom/empty-value/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238489049,"owners_count":19480880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["empty","falsy","javascript","javascript-array","javascript-objects","truthy","value"],"created_at":"2025-02-12T14:34:16.133Z","updated_at":"2025-10-27T12:30:47.095Z","avatar_url":"https://github.com/juliomatcom.png","language":"JavaScript","readme":"# empty-value\n:package: Check if a given value is empty in JS extending his \"truthy\" and \"falsy\" nature\n\n### Status\n[![Build Status](https://travis-ci.org/juliomatcom/empty-value.svg?branch=master)](https://travis-ci.org/juliomatcom/empty-value)\n\n### Installation\nUsing **npm**\n```sh\nnpm install --save empty-value\n```\n\n##### The following values are considered to be empty:\n- NaN\n- 0 (0 as an integer)\n- 0.0 (0 as a float)\n- \"0\" (0 as a string)\n- null\n- false\n- undefined\n- \"\" (an empty string)\n- \"  \" (an string with only spaces)\n- array( ) / \\[ \\] (an empty array)\n- { } (an empty object / no direct keys)\n\n### Usage\n```javascript\nvar empty = require('empty-value');\n\nempty(true) //false\nempty(12345) //false\nempty(-12345) //false\nempty('Lorem Ipsum is simply dummy text') //false\nempty([1, 2, 3]) //false\nempty({ foo: 'bar' }) //false\nempty('{ \"id\" : 1 }') //false\nempty(function () { }) //false\n\nempty(NaN) //true\nempty(0) //true\nempty(0.0) //true\nempty(null) //true\nempty(false) //true\nempty(undefined) //true\nempty('0') //true\nempty(''); //true\nempty(' '); //true\nempty([]) //true\nempty({ }) //true\n\nvar proto = { foo: 'bar' };\nvar obj = Object.create(proto);\nempty(obj) //true  Note: foo is not a directly property of obj\n```\n\n##### Using hooks\nIf *empty* can't guess the correct answer (IE: value is a function) before return FALSE you could use your own hook.      See example bellow:\n\n```javascript\nvar myEmptyHook = function (value) {//i don't like functions\n  return typeof value === 'function' ? true : false;\n}\nvar func = function () {\n  return 'bar';\n}\n\nempty(func, myEmptyHook); //true\n```\n\n###### License\n [MIT @juliomatcom](http://licsource.com/mit?name=Julio Cesar Martin\u0026year=2016\u0026email=juliomatcom@gmail.com\u0026url=http://julces.com/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliomatcom%2Fempty-value","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliomatcom%2Fempty-value","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliomatcom%2Fempty-value/lists"}