https://github.com/r3wt/object-path
object-path module for deno
https://github.com/r3wt/object-path
deno typescript
Last synced: about 1 month ago
JSON representation
object-path module for deno
- Host: GitHub
- URL: https://github.com/r3wt/object-path
- Owner: r3wt
- Created: 2020-05-09T17:23:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-10T15:15:50.000Z (about 6 years ago)
- Last Synced: 2025-05-21T16:49:51.952Z (about 1 year ago)
- Topics: deno, typescript
- Language: TypeScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### object-path: get/set object properties using path syntax
---
this module is written for Deno, but should work in node.js and the browser if compiled to javascript(its written in typescript). There are zero dependencies, except for the tests which are written using the Deno testing library.
# install
----
*Deno allows you to directly import modules from URL's! To import and use the client in your file, add the following import statement:
```ts
import { create } from 'https://raw.githubusercontent.com/r3wt/object-path/master/mod.ts';
```
# API
---
1. you should use the `create` function to create a new instance of `ObjectPathModule`.
```ts
const { parse, get, set, configure } = create({
seperator:'.',//the path seperator to use can be string or RegExp
defaultUnsetValue: undefined,//the default returned value for not existing properties.
autoCreate: false // automatically create properties if they don't exist
});// all options are shown and all returned function in the module are shown as well
```