{"id":13675137,"url":"https://github.com/brianc/node-deprecate","last_synced_at":"2025-04-10T09:30:41.685Z","repository":{"id":7312257,"uuid":"8630210","full_name":"brianc/node-deprecate","owner":"brianc","description":"Mark a method as deprecated by printing a warning to the console the first time it's called","archived":false,"fork":false,"pushed_at":"2019-07-25T18:18:24.000Z","size":8,"stargazers_count":15,"open_issues_count":4,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T19:08:27.262Z","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/brianc.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":"2013-03-07T15:21:54.000Z","updated_at":"2024-11-26T17:29:32.000Z","dependencies_parsed_at":"2022-07-21T14:19:42.335Z","dependency_job_id":null,"html_url":"https://github.com/brianc/node-deprecate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianc%2Fnode-deprecate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianc%2Fnode-deprecate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianc%2Fnode-deprecate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianc%2Fnode-deprecate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianc","download_url":"https://codeload.github.com/brianc/node-deprecate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247914322,"owners_count":21017297,"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":[],"created_at":"2024-08-02T12:00:33.294Z","updated_at":"2025-04-10T09:30:41.361Z","avatar_url":"https://github.com/brianc.png","language":"JavaScript","readme":"# deprecate\n\n[![Build Status](https://secure.travis-ci.org/brianc/node-deprecate.png?branch=master)](http://travis-ci.org/brianc/node-deprecate)\n\nMark a method as deprecated.  Write a message to a stream the first time the deprecated method is called.\n\n## api\n\n`var deprecate = require('deprecate');`\n\n### deprecate([string message1 [, string message2 [,...]]])\n\nCall `deprecate` within a function you are deprecating.  It will spit out all the messages to the console the first time _and only the first time_ the method is called.\n\n```js\nvar deprecate = require('deprecate');\n\nvar someDeprecatedFunction = function() {\n  deprecate('someDeprecatedFunction() is deprecated');\n};\n\nsomeDeprecatedFunction();\nsomeDeprecatedFunction();\nsomeDeprecatedFunction();\nconsole.log('end');\n\n//program output:\n\nWARNING!!\nsomeDeprecatedFunction() is deprecated\n\n\nend\n```\n\n### deprecate.color\n\nSet to `false` to not output a color.  Defaults to `'\\x1b[31;1m'` which is red.\n\n### deprecate.silence\n\nSet to `false` to do nothing at all when the deprecate method is called.  Useful in tests of the library you're deprecating things within.\n\n### deprecate.stream\n\nThe stream to which output is written.  Defaults to `process.stderr`\n\n## license\n\nMIT\n","funding_links":[],"categories":["命令行"],"sub_categories":["redux 扩展","macros"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianc%2Fnode-deprecate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianc%2Fnode-deprecate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianc%2Fnode-deprecate/lists"}