Advertisement
4ndr0666

Micell

Jan 11th, 2023 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.28 KB | Software | 0 0
  1. Micell
  2.  
  3. Home
  4. Docs
  5. Github (opens new window)
  6. Languages Languages
  7.  
  8. Home
  9. Docs
  10. Github (opens new window)
  11. Languages Languages
  12. Micell
  13. A collection of functions for web development
  14. Documentation →
  15. Great Various
  16. Many categories, such as character, string, date, dom, cookie, url and so on.
  17. TypeScript Support
  18. Including sufficient TypeScript type definitions
  19. Small Size
  20. Use the babel-plugin-lodash to reduce the bundle size.
  21. # What is Micell?
  22. Micell (pronounced /maɪˈsel/, like my-cell) is a collection of functions which is used with web development daily. Micell only includes the common functions in the most projects. Also, for integrity, it will include some uncommon functions.
  23. # What is not Micell?
  24.     • It is not a replace to Lodash, Momentjs or Dayjs.
  25.     • It is not to include all utility functions in your application.
  26. # Why Micell?
  27.     • Shared in community: You don't need to write the common utility functions repeatedly. Micell make reusing across all projects.
  28.     • Typescript support: Source code is written with TypeScript. And type declaration files is bundled in npm package.
  29.     • High reliability: Test in all modern browsers, even in IE 11. Up to 96% test coverage.
  30.     • Import as need: Use babel-plugin-lodash to import the used modules.
  31. # Install
  32. Npm
  33. npm i --save micell
  34. Yarn
  35. yarn add micell
  36. CDN
  37. If you want to use micell with <script> directly, you can use jsDelivr (opens new window).
  38. The latest version:
  39. <script src="https://cdn.jsdelivr.net/npm/micell"></script>
  40. The specific version:
  41. <script src="https://cdn.jsdelivr.net/npm/micell@0.15.0/dist/micell.js"></script>
  42. The ES Modules version:
  43. <script src="https://cdn.jsdelivr.net/npm/micell@0.15.0/dist/micell.esm.browser.js"></script>
  44. The micell also exists in unpkg (opens new window).
  45. # Usage
  46. import micell from 'micell'
  47.  
  48. // Generate a random string
  49. micell.randomString();
  50.  
  51. // Get a cookie value
  52. micell.cookie.get('name')
  53. More functions see the Docs.
  54. Tip: You can try micell in the console of browser which is exported as the global micell object.
  55. # Reduce the bundle size
  56. You can use the babel-plugin-lodash (opens new window) to bundle the methods as you needed.
  57. .babelrc
  58. {
  59.  "plugins": [
  60.    ["lodash", { "id": ["micell"] }]
  61.  ]
  62. }
  63. MIT Licensed | Copyright © 2019-present Alex Chao
  64.  
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement