Class Npm


  • public class Npm
    extends Object
    The NPM front. The main goal is to consume a json uploaded by npm publish command and to: 1. to generate source archives 2. meta.json file
    Since:
    0.1
    • Constructor Detail

      • Npm

        public Npm​(com.artipie.asto.Storage storage)
        Constructor.
        Parameters:
        storage - The storage.
      • Npm

        @Deprecated
        public Npm​(com.artipie.asto.Storage storage,
                   Optional<String> pathref)
        Deprecated.
        Use Npm(Storage) instead
        Constructor.
        Parameters:
        storage - The storage.
        pathref - The sources archive pathpref. Example: http://host:8080. Unused since 0.6
    • Method Detail

      • publish

        public final CompletableFuture<Void> publish​(com.artipie.asto.Key prefix,
                                                     com.artipie.asto.Key artifact)
        Publish a new version of a npm package.
        Parameters:
        prefix - Path prefix for achieves and meta information storage
        artifact - Where uploaded json file is stored
        Returns:
        Completion or error signal.
      • updateMetaFile

        public io.reactivex.Completable updateMetaFile​(com.artipie.asto.Key prefix,
                                                       com.artipie.npm.TgzArchive file)
        Updates the meta.json file based on tgz package file.
        Parameters:
        prefix - Package prefix.
        file - Tgz archive file.
        Returns:
        Completion or error signal.