{"id":20226235,"url":"https://github.com/steamerjs/steamer-browserutils","last_synced_at":"2025-10-28T02:02:31.735Z","repository":{"id":57370583,"uuid":"64545777","full_name":"steamerjs/steamer-browserutils","owner":"steamerjs","description":"browser utils","archived":false,"fork":false,"pushed_at":"2018-06-11T14:43:24.000Z","size":233,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T10:27:57.630Z","etag":null,"topics":[],"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/steamerjs.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-07-30T13:36:50.000Z","updated_at":"2018-08-14T06:36:12.000Z","dependencies_parsed_at":"2022-08-29T16:42:15.901Z","dependency_job_id":null,"html_url":"https://github.com/steamerjs/steamer-browserutils","commit_stats":null,"previous_names":["steamerteam/steamer-browserutils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steamerjs/steamer-browserutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-browserutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-browserutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-browserutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-browserutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steamerjs","download_url":"https://codeload.github.com/steamerjs/steamer-browserutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-browserutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281371795,"owners_count":26489526,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-14T07:16:52.392Z","updated_at":"2025-10-28T02:02:31.708Z","avatar_url":"https://github.com/steamerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## steamer-browserutils\nBrowser utils for development\n\n[![NPM Version](https://img.shields.io/npm/v/steamer-browserutils.svg?style=flat)](https://www.npmjs.com/package/steamer-browserutils)\n[![Travis](https://img.shields.io/travis/steamerjs/steamer-browserutils.svg)](https://travis-ci.org/steamerjs/steamer-browserutils)\n[![Deps](https://david-dm.org/steamerjs/steamer-browserutils.svg)](https://david-dm.org/steamerjs/steamer-browserutils)\n[![Coverage](https://img.shields.io/coveralls/steamerjs/steamer-browserutils.svg)](https://coveralls.io/github/steamerjs/steamer-browserutils)\n\n\n### Functions\nFor usage details, you can checkout `./src/libs/`\n####\n* class\n\t- extend\n* common\n\t- _stringify\n\t- _parse\n* cookie\n\t- setCookie\n\t- delCookie\n\t- getCookie\n* date\n\t- formatDate\n* localstorage\n\t- setItem\n\t- delItem\n\t- getItem\n* native\n\t- callApi\n* safe\n\t- encodeHTML\n\t- decodeHTML\n* type\n\t- isType\n\t- isBoolean\n\t- isNumber\n\t- isString\n\t- isFunction\n\t- isArray\n\t- isDate\n\t- isRegExp\n\t- isObject\n\t- isError\n* url\n\t- getHash\n \t- getQuery\n \t- getUrlParam\n\n### Usage\nYou can require the file like this:\n```\n// Node\nlet utils = require('steamer-browserutils');\n// or\nlet utils = require('steamer-browserutils/dist/index.cjs.js); \n\n// ES6\nimport { extend, isType } from 'steamer-browserutils/dist/index.esm.js';\n\n// umd\n// you can use index.umd.js\n```\n\nBy default, we require `steamer-browserutils/index.js` which is an `es5` version. However, sometimes you may need `es6` version for tree-shaking in `webpack` or `rollup`, then you can explicitly require `steamer-browserutils/index.esm.js`.\n\nYou also need to notice that compling tool like `webpack` may exclude `node_modules` when compling js files in order to speed up the whole compling process. If so, please remove this config or just put `./dist/index.esm.js` in your `src` folder.\n```\n{ \n    test: /\\.js?$/,\n    loader: 'babel',\n    query: {\n        // cacheDirectory: './webpack_cache/',\n        plugins: ['transform-decorators-legacy'],\n        presets: [\n            'es2015-loose', \n            'react',\n        ]\n    },\n    exclude: /node_modules/,\n},\n```\n\n### Customized library\nIf you hope to customized certain types of APIs. For example, if you hope to exclude `safe` and `native` APIs, you can modify `./src/mains`.js by commenting `safe` and `natve` `export`.\n\n```\n// export {\n//     callApi,\n// } from './libs/native';\n// export {\n//     encodeHTML,\n//     decodeHTML\n// } from './libs/safe';\n```\n\nPlease be cautious if you want to exlucde `common` since other APIs use its functions.\n\n### Test\n```javascript\nnpm test\n```\n\n\n### Changelog\n* v0.5.0 finish basic features and add es6 and es5 support\n* v1.0.0 add test\n* v1.0.1 compatible with global\n* v2.0.0 use rollup to bundle\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-browserutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamerjs%2Fsteamer-browserutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-browserutils/lists"}