Package Exports
- repo-md
- repo-md/min
Readme
Repo.md 💙 JS
A lightweight JavaScript client library for fetching and working with content stored in the repo.md API. The library provides easy access to posts, media, and other content stored in your repo.md projects.
Note: This is an early preview release of our JavaScript SDK. API routes and method names might change as we extend functionalities. We look forward to seeing developers play with it!
Installation
NPM
npm i repo-md
Use in your favourite frameworks
Deploy apps on the edge:
CDN (Browser)
You can also include repo-md directly in your HTML via CDN:
<!-- From unpkg (recommended) -->
<script src="https://unpkg.com/repo-md"></script>
<!-- Or from jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/repo-md"></script>
<!-- Minified versions for production -->
<script src="https://unpkg.com/repo-md/repo-md.min.umd.cjs"></script>
<script src="https://cdn.jsdelivr.net/npm/repo-md/repo-md.min.umd.cjs"></script>
When loaded via CDN, the library is available as a global variable RepoMD
:
<script>
const repo = new RepoMD.RepoMD({
orgSlug: "iplanwebsites",
projectSlug: "port1g",
projectId: "680e97604a0559a192640d2c",
});
// Use repo client methods
repo.getAllPosts().then((posts) => {
console.log(posts);
});
</script>
UMD Module in Node.js
If you need to use the UMD module in a Node.js project that doesn't support ES modules:
// Using require with the UMD build
const RepoMD = require("repo-md/min").RepoMD;
// Initialize the client
const repo = new RepoMD({
orgSlug: "iplanwebsites",
projectSlug: "port1g",
projectId: "680e97604a0559a192640d2c",
});
// Use client methods
repo.getAllPosts().then((posts) => {
console.log(posts);
});
Docs
All details on endpoints can be found here:
Contributing
We welcome contributions to improve the repo.md client library! If you'd like to contribute, please feel free to submit a pull request. Whether it's fixing bugs, improving documentation, or adding new features, your help is appreciated.
Developing the Demo
The repo includes a demo application built with React that showcases the library's capabilities.
To run the demo locally:
npm run dev:demo
This will start the demo on http://localhost:5174.
Roadmap
Here are some planned improvements for future releases:
- Implement more API endpoints
- Better validation and logging with configurable debug levels
- Improved TypeScript types
- Enhanced playground demo
- Python SDK
- Command line tools
- And more...
We're constantly working to improve the library based on developer feedback.
License
MIT