{"id":13671479,"url":"https://github.com/jonschlinkert/is-primitive","last_synced_at":"2025-04-07T17:09:34.792Z","repository":{"id":21184755,"uuid":"24490783","full_name":"jonschlinkert/is-primitive","owner":"jonschlinkert","description":"Is the typeof value a javascript primitive?","archived":false,"fork":false,"pushed_at":"2021-03-20T04:24:09.000Z","size":19,"stargazers_count":37,"open_issues_count":3,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T14:14:46.823Z","etag":null,"topics":["check","is","javascript","jonschlinkert","kind-of","node","nodejs","number","primitive","primitive-values","string","symbol","type","typeof"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-26T07:40:27.000Z","updated_at":"2024-08-20T07:16:50.000Z","dependencies_parsed_at":"2022-08-28T05:40:23.551Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/is-primitive","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fis-primitive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fis-primitive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fis-primitive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fis-primitive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/is-primitive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"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":["check","is","javascript","jonschlinkert","kind-of","node","nodejs","number","primitive","primitive-values","string","symbol","type","typeof"],"created_at":"2024-08-02T09:01:10.650Z","updated_at":"2025-04-07T17:09:34.741Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# is-primitive [![NPM version](https://img.shields.io/npm/v/is-primitive.svg?style=flat)](https://www.npmjs.com/package/is-primitive) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-primitive.svg?style=flat)](https://npmjs.org/package/is-primitive) [![NPM total downloads](https://img.shields.io/npm/dt/is-primitive.svg?style=flat)](https://npmjs.org/package/is-primitive) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-primitive.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/is-primitive)\n\n\u003e Returns `true` if the value is a primitive.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save is-primitive\n```\n\n## Primitive values\n\nThe [Mozilla docs for \"Primitive values\"](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Primitive_values) defines specifies six data types that are primitives:\n\n* `Boolean`\n* `Null`\n* `Undefined`\n* `Number`\n* `String`\n* `Symbol` (new in ECMAScript 6)\n\n## Usage\n\n```js\nvar isPrimitive = require('is-primitive');\n```\n\n## true\n\nAll of the following return `true`:\n\n```js\nconsole.log(isPrimitive(false));\nconsole.log(isPrimitive(true));\nconsole.log(isPrimitive(null));\nconsole.log(isPrimitive());\nconsole.log(isPrimitive(42));\nconsole.log(isPrimitive('abc'));\nconsole.log(isPrimitive(Symbol()));\n//=\u003e true\n```\n\n## false\n\nEverything else returns `false`:\n\n```js\nconsole.log(isPrimitive({}));\nconsole.log(isPrimitive([]));\nconsole.log(isPrimitive(function(){}));\nconsole.log(isPrimitive(new Date()));\n// et cetera...\n//=\u003e false\n```\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number \"Returns true if the value is a number. comprehensive tests.\")\n* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object \"Returns true if an object was created by the `Object` constructor.\")\n* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of \"Get the native type of a value.\")\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 11 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 1 | [ljharb](https://github.com/ljharb) |\n| 1 | [bttmly](https://github.com/bttmly) |\n| 1 | [hemanth](https://github.com/hemanth) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 23, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fis-primitive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fis-primitive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fis-primitive/lists"}