First frontend = browser, backend = nodejs. You surely mean that LowDB is available as a NodeJS module, which means it can be installed with NPM, either for frontend or backend development.
If you're not using NPM for your frontend development, you can still import modules with <script>
tags.
Let's see an example using only HTML/javascript:
(from the doc):
<html>
<head>
<script src="https://unpkg.com/lodash@4/lodash.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/low.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/LocalStorage.min.js"></script>
</head>
<body>
<button onclick="add()">Add Post</button>
<button onclick="load()">Load Post</button>
<div></div>
</body>
<script>
var adapter = new LocalStorage('db')
var db = low(adapter)
db.defaults({ posts: [] })
.write()
function add() {
// Data is automatically saved to localStorage
db.get('posts')
.push({ title: 'lowdb' })
.write()
}
function load() {
var div = document.querySelector('div')
var text = div.innerText;
text += db.get('posts').map(post=>post.title).join(';');
div.innerText = text
}
</script>
</html>
See this work: https://codepen.io/bcaure/pen/ExgBPBz
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…