2.5.0 • Published 3 years ago
@noobjsperson/edit-json v2.5.0
edit-json
A small package to edit your json files with ease
Documentation
Example:
//defining the package
const edit = require('@noobjsperson/edit-json');
// creating an instance of EditClient with './storage.json' as the default file
const client = new edit('./storage.json');
// assign a value to a property in the default file
client.set('color','blue')
//result {"color":"blue"}
EditClient(file, dirname, relative)
Params
- String
file
: the default directory of the file you want to edit - String
dirname
: the directory that the client edits files relatively from - Boolean
relative
: to specifying if the default directory should be relative to the location of the file that the function got called in
Returns
- EditClient The instance of the
EditClient
class
set(property, value, file, relative)
Params
- String
property
: the name of the property you to edit/create. - String
value
: the value assigned to the property it can be a number, string or another object - String
file
: the directory of the file you want to edit (if empty it'll edit the default file that got passed to the EditClient's constructor) Boolean
relative
: a boolean specifying if the directory should be relative to the location of the file that the function got called in.
Returns
An empty promise.
delete(property, file, relative)
Params
- String
property
: the name of the property you to delete. - String
file
: the directory of the file you want to edit (if empty it'll edit the default file that got passed to the EditClient's constructor) - Boolean
relative
: a boolean specifying if the directory should be relative to the location of the file that the function got called in.
Returns
An empty promise.
Disclaimer
this package is still under development consider contributing to it in the GitHub repository
2.5.0
3 years ago
2.4.3
3 years ago
2.4.2
3 years ago
2.4.5
3 years ago
2.4.4
3 years ago
2.4.7
3 years ago
2.4.6
3 years ago
2.4.1
3 years ago
2.4.0
3 years ago
2.3.0
3 years ago
2.2.0
3 years ago
2.3.2
3 years ago
2.3.1
3 years ago
2.1.8
3 years ago
2.1.9
3 years ago
2.1.10
3 years ago
2.1.7
3 years ago
2.1.6
3 years ago
2.1.5
3 years ago
2.1.4
3 years ago
2.1.3
3 years ago
2.1.2
3 years ago
2.1.1
3 years ago
2.1.0
3 years ago
2.0.0
3 years ago
1.1.6
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.1
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago