Simple library to load, handle and convert data in different types such as JSON, CSV, XML, and YAML
Warning
This project is under development. Some functionalities mentioned in this README are not implemented yet.
Note
This project is currently maintained by a campus club, and we are prioritizing contributions from club members for existing issues. While we may not assign these issues to external contributors at the moment, you're still welcome to contribute by improving other areas or suggesting new ideas.
What can you do with this library?
- Load data in many formats from text or from a file (currently supports json, csv, xml, yaml)
- Convert data into any format (currently supports json, csv, xml, yaml)
Ensure you have Node.js installed in your system (recommended Node.js v18 or higher).
# run the following command to install
$ npm install anydataimport { csv, json, xml, yaml } from anydata
// load json from text
const data1 = json.from('{ "a": 1 }')
// load json from a file
const data2 = await json.loadFile("data.json")
// access data
data1.data
// convert data into other formats
data1.toYaml()
// export data as a file into other formats
await data1.exportYaml("export.yml")Feel free to submit new features, improvements, or bug fixes.
- Before starting, check the Issues tab to see if someone is already working on it.
- If not, open a new issue describing your idea or bug, and request to be assigned.
- You can also browse existing issues and ask to take one on.
First, fork the repository to your GitHub account and then clone it locally.
# Fork the repo (click the 'Fork' button on GitHub)
# Clone the forked repo
$ git clone https://github.com/YOUR-USERNAME/anydata.git
$ cd anydataOnce assigned, create a new branch for your work:
$ git checkout -b feature/your-feature-name- Make your changes and test them locally.
- Follow formatting and coding standards
- Ensure your code passes:
- Format checks
- Linter checks
- All tests
Check the Available scripts section to see scripts available for above purposes.
Follow Conventional Commits for commit messages.
Avoid large PRs; make atomic commits.
Example:
$ git add .
$ git commit -m "feat: added a new about section"$ git push origin feature/your-feature-nameGo to the GitHub repository, open a Pull Request (PR) from your branch, and add a short description.
The following scripts are available for developers
npm install --include=dev: installs all the necessary dependencies (make sure to include the--include=devflag)npm run build: bundles the librarynpm run lintornpm run lint:fix: Runs the linter against the code.lint:fixvariant attempts to fix any linter issues.npm run format: Format the code according to repository standards.npm test: Test the code
If you have any questions:
- Check the existing issues or discussions.
- Reach out to the Mozilla Campus Club of SLIIT team.
- Open a new issue if needed.