You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.6 KiB

4 years ago
  1. util-deprecate
  2. ==============
  3. ### The Node.js `util.deprecate()` function with browser support
  4. In Node.js, this module simply re-exports the `util.deprecate()` function.
  5. In the web browser (i.e. via browserify), a browser-specific implementation
  6. of the `util.deprecate()` function is used.
  7. ## API
  8. A `deprecate()` function is the only thing exposed by this module.
  9. ``` javascript
  10. // setup:
  11. exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
  12. // users see:
  13. foo();
  14. // foo() is deprecated, use bar() instead
  15. foo();
  16. foo();
  17. ```
  18. ## License
  19. (The MIT License)
  20. Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
  21. Permission is hereby granted, free of charge, to any person
  22. obtaining a copy of this software and associated documentation
  23. files (the "Software"), to deal in the Software without
  24. restriction, including without limitation the rights to use,
  25. copy, modify, merge, publish, distribute, sublicense, and/or sell
  26. copies of the Software, and to permit persons to whom the
  27. Software is furnished to do so, subject to the following
  28. conditions:
  29. The above copyright notice and this permission notice shall be
  30. included in all copies or substantial portions of the Software.
  31. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  32. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  33. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  34. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  35. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  36. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  37. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  38. OTHER DEALINGS IN THE SOFTWARE.