mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
15 lines
384 B
TypeScript
15 lines
384 B
TypeScript
|
import { Manifest } from '@verdaccio/types';
|
||
|
|
||
|
import { Storage } from '../src/storage';
|
||
|
|
||
|
export const addPackageToStore = (storage: Storage, pkgName: string, metadata: Manifest) => {
|
||
|
return new Promise((resolve, reject) => {
|
||
|
storage.addPackage(pkgName, metadata, (err, data) => {
|
||
|
if (err) {
|
||
|
return reject(err);
|
||
|
}
|
||
|
return resolve(data);
|
||
|
});
|
||
|
});
|
||
|
};
|