ArcherGu / easy-property-retriever

A little tool used to get object properties.

Home Page:https://archergu.github.io/easy-property-retriever

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Easy Property Retriever

npm package checks license

easy-property-retriever is a little tool used to get object properties. this lib is taken from MDN.

Quick start

Install

Install with NPM or Yarn

# npm
npm install --save easy-property-retriever
# yarn
yarn add --save easy-property-retriever

Or link to the source code directly

<script src="dist/easy-property-retriever.min.js"></script>

Name EasyPropertyRetriever is ready to use and no need to import.

Or CDN

<script src="https://unpkg.com/easy-property-retriever/dist/easy-property-retriever.min.js"></script>

Name EasyPropertyRetriever is ready to use and no need to import.

How to use

import EasyPropertyRetriever from 'easy-property-retriever';

function Person() {
  this.propA = 1;
  this.propB = 2;
}

const props = EasyPropertyRetriever.getOwnEnumerables(new Person());

console.log(props);

// Output:
// > ['propA', 'propB']

Documentation

Documentation

Run the unit tests

yarn test

License

The code in this project is licensed under MIT license.

About

A little tool used to get object properties.

https://archergu.github.io/easy-property-retriever

License:MIT License


Languages

Language:TypeScript 84.0%Language:JavaScript 16.0%