Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
products_lesson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pavel Mishakov
products_lesson
Commits
54dd76c8
Commit
54dd76c8
authored
Feb 24, 2023
by
Pavel Mishakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add readme file
parent
554cc75b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
3 deletions
+25
-3
README.md
README.md
+18
-0
db.json
db.json
+0
-1
db.json
db/db.json
+1
-0
fileDB.ts
src/repository/fileDB.ts
+6
-2
No files found.
README.md
0 → 100644
View file @
54dd76c8
# 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
db.json
deleted
100644 → 0
View file @
554cc75b
[{
"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
db/db.json
0 → 100644
View file @
54dd76c8
[{
"title"
:
"Apple"
,
"price"
:
77
,
"description"
:
"This is an apple"
,
"id"
:
"ea4f2bd1-2d5a-42ea-99e6-50a125bfe82d"
}]
\ No newline at end of file
src/repository/fileDB.ts
View file @
54dd76c8
...
...
@@ -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'
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment