A lightweight blog engine written in TypeScript.
NOTE: THIS IS NOT PUBLISHED YET SO DON'T EXPECT IT TO WORK!
npm
npm install @jsblog/core
yarn
yarn add @jsblog/core
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!',
});
});
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:
npm install @jsblog/mongodb
npm install @jsblog/mysql
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
git clone
cd jsblog
yarn
yarn build:dev
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.
yarn global add ./dev
tttt create <package-name>