For example, there is an npm package called redis-orm
It has a usage method,
const a = new Orm();
a.where('id','=','3')
.getOne();
So, how can I add a new function to it without changing its source code:
const a = new Orm();
a.where('id','=','3')
.getMany(); ------> New Feature
npm download this package and import it.
var redisOrm = require('redis-orm');
This is really not easy to do if you don’t change its source code. You can take a look at its source code, and then optionally add it using a prototype.