https://github.com/xpodev/jsblog
A lightweight blog engine written in TypeScript.
https://github.com/xpodev/jsblog
Last synced: about 1 year ago
JSON representation
A lightweight blog engine written in TypeScript.
- Host: GitHub
- URL: https://github.com/xpodev/jsblog
- Owner: xpodev
- Created: 2023-01-27T03:53:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-18T14:23:10.000Z (over 2 years ago)
- Last Synced: 2025-05-08T20:06:10.923Z (about 1 year ago)
- Language: TypeScript
- Size: 503 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JS Blog
A lightweight blog engine written in TypeScript.
## Installation
**NOTE**: THIS IS NOT PUBLISHED YET SO DON'T EXPECT IT TO WORK!
npm
```bash
npm install @jsblog/core
```
yarn
```bash
yarn add @jsblog/core
```
## Usage
```js
const { Blog } = require('@jsblog/core');
const { MongoAdapter } = require('@jsblog/mongodb');
const adapter = new MongoAdapter({
uri: 'mongodb://localhost:27017/jsblog',
});
const blog = new Blog({
adapter,
});
blog.init().then(() => {
blog.createPost({
title: 'Hello World',
content: 'This is my first post!',
});
});
```
## Adapters
The core package only provides the basic functionality of the blog engine. To use a database, you need to install an adapter. The following adapters are available:
### MongoDB
```bash
npm install @jsblog/mongodb
```
### MySQL
```bash
npm install @jsblog/mysql
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
### Development
```bash
git clone
cd jsblog
yarn
yarn build:dev
```
### Add new package
If you want to add a new package, you can use the `tttt` cli tool. It will create a new package with the correct folder structure and files, also it will add the package to the tsconfig.json file.
```bash
yarn global add ./dev
```
```bash
tttt create
```