js-tools
Welcome to the readme for our js-tools! This library is designed to provide a set of useful functions and tools that can be used in a variety of JavaScript projects.
How to use
Simply include the library in your project and you'll have access to a range of utility functions. These functions are organized into various modules, each with its own set of related functions.
Instalation
To be defined:
npm install js-tools
Example
import { getObjectValue } = from 'js-tools';
const obj = { foo: { bar: { baz: 42 } } }
console.log(getObjectValue(obj, 'foo.bar.baz'));
TypeScript Support
Even though this library is written in JavaScript, it provides type definitions and can be used seamlessly in TypeScript projects. Simply install the library and TypeScript will automatically pick up the types.
Available scripts
In the project directory, you can run:
npm run build
npm test
npm run coverage
npm run lint
npm run lint:fix
npm run prepare
npm run doc
npm run generate-docs
Project Folder Structure
This project follows a standard folder structure to keep the code organized and maintainable. Below is a brief explanation of the folder structure.
├── src/
│ ├── modules/
│ │ ├── analytics/
│ │ ├── arrays/
│ │ ├── objects/
│ │ ├── strings/
│ │ ├── validations/
│ │ └── ...
│ ├── index.js
│ └── ...
├── __tests__/
│ │ ├── analytics/
│ │ ├── arrays/
│ │ ├── objects/
│ │ ├── strings/
│ │ ├── validations/
│ └── ...
├── docs/
│ └── README.md
├── package.json
├── README.md
├── vite.config.js
├── vitest.config.js
└── ...
-
src/
This folder contains all the source code for the js-tools. The modules are organized into subfolders based on their respective functionalities.
-
modules/
This subfolder contains all the modules that make up the js-tools. The modules are organized into subfolders based on their respective functionalities.
-
index.js
This file exports all the utility functions from their respective modules, making it easier to import them in other JavaScript files.
-
tests/
This contains all the unit tests for the modules that make up the js-tools and are organized into subfolders based on their respective functionalities. The tests are created with vitest
-
index.js
This file contains the code to run all the unit tests for the js-tools.
-
docs/
This folder contains all the documentation for the js-tools based on jsdoc.
-
package.json
This file contains the project's metadata, including the project name, version, and dependencies.
-
vite.config.js
This file contains the configuration settings for Vite, a build tool used for the project's development environment.
-
vite.test.config.js
This file contains the configuration settings for Vitest used for running the project's unit tests.
Contributing
Contributions are welcome! Here are a few things to keep in mind when contributing:
- Try to make your functions pure and avoid side effects.
- Make sure to add unit tests for any new functionality you add.
- Generate the documentation using the
npm run generate-docs
command before submitting your changes.