zengenti-utils

0.3.0 • Public • Published

Utils

This module/repo contains a collection of general utilities.

add(Number, Number)

Example util for testing that this module works, and utils can be imported into external projects. It adds two numbers.

getSymbolDescription(Symbol)

This is used in PublishSubscribe module to get the string value passed into Symbol(string), which should be on the symbol.description property, but it is not in every environment, which is why this function was made.

hasKey(object:Object, key: String)

Returns Boolean, true if key is a key on object, else false.


structure/

The structure/ folder is for development, used as the input folder when utilizing https://www.npmjs.com/package/zengenti-make-component, when defining a new util.


Contribute

TLDR; If you want to add a util to this repository, export it in main.js and then publish with sudo np.

Guidelines:

  1. Install make-component with npm i zengenti-make-component -g (only do this once).

  2. Clone and cd this repository to your local filesystem.

  3. Run this command make-component nameOfUtil src structure and change nameOfUtil to the name of your utility. src is output directory, and structure is input directory.

  4. Paste and export your code from your src/nameOfUtil/nameOfUtil.js file.

  5. Additionally, paste any existing test code, or write some new test code in the .test.js file. This uses mocha which should be sufficient for utils.

  6. Add info about your util to the README.md file

  7. export your util in main.js to expose it for use in external code which imports our 'zengenti-utils' module.

  8. npm i to install the repo, and then npm run test to run the tests. Check that they all pass before proceeding, else fix the issue.

  9. Kindly ask a colleague to review the changes / code, and push this to the remote git repo.

  10. Publish the module zengenti-utils using sudo np (see np on github)

TODO

  • Automate adding a new component more, so that it adds the import/export to main.js and makes an entry in README.md

Readme

Keywords

Package Sidebar

Install

npm i zengenti-utils

Weekly Downloads

7

Version

0.3.0

License

Contact us

Unpacked Size

3.64 kB

Total Files

7

Last publish

Collaborators

  • georgecampbell