A lightweight blog engine written in TypeScript.
NOTE: THIS IS NOT PUBLISHED YET SO DON'T EXPECT IT TO WORK!
npm
npm install @jsblog/coreyarn
yarn add @jsblog/coreconst { 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/mongodbnpm install @jsblog/mysqlPull 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:devIf 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 ./devtttt create <package-name>