{"id":13592079,"url":"https://github.com/jsmini/type","last_synced_at":"2025-04-08T23:30:47.714Z","repository":{"id":31699328,"uuid":"128631783","full_name":"jsmini/type","owner":"jsmini","description":"JS Type Detection Library, addresses the issues with 'typeof', compatible natively with IE6.","archived":false,"fork":false,"pushed_at":"2023-11-21T08:14:10.000Z","size":846,"stargazers_count":65,"open_issues_count":10,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T22:09:51.183Z","etag":null,"topics":["jslib","jsmini"],"latest_commit_sha":null,"homepage":"","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/jsmini.png","metadata":{"files":{"readme":"README-zh_CN.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"custom":["https://yanhaijing.com/mywallet/"]}},"created_at":"2018-04-08T10:58:00.000Z","updated_at":"2024-04-23T22:09:51.184Z","dependencies_parsed_at":"2024-01-14T04:35:22.015Z","dependency_job_id":"fceba3d1-2f40-4154-8603-99f2d71bf470","html_url":"https://github.com/jsmini/type","commit_stats":{"total_commits":53,"total_committers":4,"mean_commits":13.25,"dds":"0.39622641509433965","last_synced_commit":"311a7559fee57a7e299d52186518780be921fad6"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmini%2Ftype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmini%2Ftype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmini%2Ftype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmini%2Ftype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsmini","download_url":"https://codeload.github.com/jsmini/type/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223346535,"owners_count":17130457,"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":["jslib","jsmini"],"created_at":"2024-08-01T16:01:05.574Z","updated_at":"2025-04-08T23:30:47.707Z","avatar_url":"https://github.com/jsmini.png","language":"JavaScript","funding_links":["https://yanhaijing.com/mywallet/"],"categories":["JavaScript"],"sub_categories":[],"readme":"# [type](https://github.com/jsmini/type)\n\n[![](https://img.shields.io/badge/Powered%20by-jslib%20base-brightgreen.svg)](https://github.com/yanhaijing/jslib-base)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jsmini/type/blob/master/LICENSE)\n[![CI](https://github.com/jsmini/type/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jsmini/type/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/badge/npm-0.12.0-orange.svg)](https://www.npmjs.com/package/@jsmini/type)\n[![NPM downloads](http://img.shields.io/npm/dm/@jsmini/type.svg?style=flat-square)](http://www.npmtrends.com/@jsmini/type)\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/jsmini/type.svg)](http://isitmaintained.com/project/jsmini/type 'Percentage of issues still open')\n\n类型检测库，弥补typeof的问题，原生兼容IE6\n\n[English](./README.md) | 简体中文\n\n## 兼容性\n\n单元测试保证支持如下环境：\n\n| IE  | CH  | FF  | SF  | OP  | IOS | 安卓 | Node  |\n| --- | --- | --- | --- | --- | --- | ---- | ----- |\n| 6+  | 23+ | 4+  | 6+  | 10+ | 5+  | 2.3+ | 0.10+ |\n\n## 目录介绍\n\n```\n.\n├── demo 使用demo\n├── dist 编译产出代码\n├── doc 项目文档\n├── src 源代码目录\n├── test 单元测试\n├── CHANGELOG.md 变更日志\n└── TODO.md 计划功能\n```\n\n## 如何使用\n\n通过npm下载安装代码\n\n```bash\n$ npm install --save @jsmini/type\n```\n\n如果你是node环境\n\n```js\nvar type = require('@jsmini/type').type;\n\ntype(1); // 'number'\ntype(true); // 'boolean'\n```\n\n如果你是webpack等环境\n\n```js\nimport { type } from '@jsmini/type';\n\ntype(1); // 'number'\ntype(true); // 'boolean'\n```\n\n如果你是requirejs环境\n\n```js\nrequirejs(\n  ['node_modules/@jsmini/type/dist/index.aio.js'],\n  function (jsmini_type) {\n    var type = jsmini_type.type;\n\n    type(1); // 'number'\n    type(true); // 'boolean'\n  },\n);\n```\n\n如果你是浏览器环境\n\n```html\n\u003cscript src=\"node_modules/@jsmini/type/dist/index.aio.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n  var type = jsmini_type.type;\n\n  type(1); // 'number'\n  type(true); // 'boolean'\n\u003c/script\u003e\n```\n\n## 文档\n\n[API](https://github.com/jsmini/type/blob/master/doc/api.md)\n\n## 贡献指南 ![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)\n\n首次运行需要先安装依赖\n\n```bash\n$ npm install\n```\n\n一键打包生成生产代码\n\n```bash\n$ npm run build\n```\n\n运行单元测试，浏览器环境需要手动测试，位于`test/browser`\n\n```bash\n$ npm test\n```\n\n修改package.json中的版本号，修改README.md中的版本号，修改CHANGELOG.md，然后发布新版\n\n```bash\n$ npm run release\n```\n\n将新版本发布到npm\n\n```bash\n$ npm publish\n```\n\n## 更新日志\n\n[CHANGELOG.md](https://github.com/jsmini/type/blob/master/CHANGELOG.md)\n\n## 计划列表\n\n[TODO.md](https://github.com/jsmini/type/blob/master/TODO.md)\n\n## 谁在使用\n\n- [is](https://github.com/jsmini/is)\n- [querystring](https://github.com/jsmini/querystring)\n- [clone](https://github.com/jsmini/clone)\n- [react-compare](https://github.com/fXy-during/react-compare)\n- [z](https://github.com/PinghuaZhuang/z)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsmini%2Ftype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsmini%2Ftype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsmini%2Ftype/lists"}