Пример #1
0
 public NodePackageService(
     IServiceProvider services,
     NodePackageServiceOptions options,
     Func <IServiceProvider, PackagePathSegments, Task <string> > versionProvider = null)
     : base(services, options, versionProvider)
 {
     this._Options = options;
 }
Пример #2
0
 public static void AddNodePackageService <T>(this IServiceCollection services,
                                              NodePackageServiceOptions options)
     where T : IVersionProvider
 {
     services.AddSingleton(sp => new NodePackageService(sp, options, (s, path) => {
         var st = s.GetRequiredService <T>();
         return(st.GetVersionAsync(path));
     }));
 }
        public NodePackageService(
            IServiceProvider services,
            NodePackageServiceOptions options)
        {
            var reg = options.NPMRegistry.TrimEnd('/') + "/";

            this.Options             = options;
            this.Options.NPMRegistry = reg;
            this.privatePackages     = options.PrivatePackages.Select(x => {
                return(new PackagePath(options, x.ParseNPMPath(), true));
            });
            this.cache    = services.GetService <IMemoryCache>();
            this.services = services;
        }
 public PackagePath(
     NodePackageServiceOptions options,
     (string, string, string) p,
Пример #5
0
 public static void AddNodePackageService(this IServiceCollection services,
                                          NodePackageServiceOptions options)
 {
     services.AddSingleton(sp => new NodePackageService(sp, options, null));
 }