Commit 54dd76c8 authored by Pavel Mishakov's avatar Pavel Mishakov

add readme file

parent 554cc75b
# Pasha
## _Homework #82_
[![N|Solid](https://cldup.com/dTxpPi9lDf.thumb.png)](https://nodesource.com/products/nsolid)
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)
Dillinger is a cloud-enabled, mobile-ready, offline-storage compatible,
AngularJS-powered HTML5 Markdown editor.
- ✨MyPage Mewssage
## Features
- Import a HTML file and watch it magically convert to Markdown
- Drag and drop images (requires your Dropbox account be linked)
- Import and save files from GitHub, Dropbox, Google Drive and One Drive
- Drag and drop markdown and HTML files into Dillinger
- Export documents as Markdown, HTML and PDF
\ No newline at end of file
[{"title":"Banana","price":100,"description":"This is a banana","id":"4984df1f-9cbb-49c4-8934-426233479c81"},{"title":"Apple","price":77,"description":"This is an apple","id":"5525dded-afcf-4a60-ab78-813b0d4a27c4"}]
\ No newline at end of file
[{"title":"Apple","price":77,"description":"This is an apple","id":"ea4f2bd1-2d5a-42ea-99e6-50a125bfe82d"}]
\ No newline at end of file
......@@ -8,7 +8,7 @@ class FileDB {
filename: string
constructor() {
this.data = []
this.filename = './db.json'
this.filename = './db/db.json'
}
init = async () => {
try {
......@@ -18,7 +18,11 @@ class FileDB {
const error = err as Error
console.log(error.message)
this.data = [];
await fs.writeFile('./db.json', JSON.stringify(this.data), {encoding: 'utf-8'})
const dir = await fs.readdir('./db')
if (!dir) {
await fs.mkdir('./db')
}
await fs.writeFile(this.filename, JSON.stringify(this.data), {encoding: 'utf-8'})
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment