Skip to content

afeiship/next-instance

Repository files navigation

next-instance

Create an instance without new.

version license size download

installation

npm install -S @jswork/next-instance

usage

import '@jswork/next-instance';

class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }
}

const p1 = nx.instance(Person, 'fei', 100);
// Person { name: 'fei', age: 100 }

license

Code released under the MIT license.