npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

txz-web-deploy

v0.0.2

Published

txz web deploy scripts

Readme

txz-web-deploy

This package is under testing, please do not use it in production environment.

This npm package is for txz company and supports transferring files to ftp and ali-oss servers.

install

npm install txz-web-deploy

usage

A file named txzDeploy.config.js needs to exist in the running directory.
The config file export default a javascript object.

txzDeploy.config.js file look like this:

export default {
  targetFolder: "dist",
  ossConfig: {
    beforeUpload: (arg) => {
      const {extname, env, relativePath} = arg;
      return extname === ".html" ? `${env}/${relativePath}` : relativePath;
    },
    servers: {
      region: "oss-region",
      accessKeyId: "your-access-key-id",
      accessKeySecret: "your-access-key-secret",
      bucket: "your-bucket-name",
      secure: true,
    },
  },
  ftpConfig: {
    includes: [".html"],
    servers: {
      test: [
        {
          host: "encrypt-host",
          port: "encrypt-port",
          username: "encrypt-username",
          password: "encrypt-password",
          remote_path: ["encrypt-remote-path"],
        },
      ],
    },
  },
}

run command, your configuration will be merged with the default configuration.

txz-web-deploy <CUSTOM_ENV_NAME> <DECRYPT_KEY>
# the following command means to use the ftp server of the test environment
# and use"TEST_KEY" to decrypt configuration.
txz-web-deploy test TEST_KEY

If there is no problem with your configuration, then you will see the deployment process and results.

configuration

  • debug:
    Boolean type, default is false, if set to true, the file will not be pushed to the server.
  • targetFolder:
    String type, default is "", and the workspace is the path of targetFolder relative to __dirname.
  • ossConfig
    Not required, if it doesn't exist, just a waring log will be printed to remind you.
    • ossConfig.domain:
      Reserved key
    • ossConfig.uploadPath:
      String type, default is "", files will be uploaded to this path of the server.
    • ossConfig.excludes:
      Array type, default is [], file extname in this array will not be uploaded. Extname needs to be prefixed with ., such as [".html"]. if ossConfig.includes is set, this will be invalid.
    • ossConfig.includes:
      Array type, default is [], only file with extname in the array will be uploaded. Extname needs to be prefixed with ., such as [".html"]. if this is set, ossConfig.excludes will be invalid.
    • ossConfig.beforeUpload:
      If it exists, must be a function and return to string. Its arguments is an object containing env, extname, filePath and relativePath.
    • ossConfig.servers:
      Default is null, if you want to use oss server, you must be set it.
      • ossConfig.servers.region: string type, oss-region.
      • ossConfig.servers.accessKeyId: string type, your-access-key-id.
      • ossConfig.servers.accessKeySecret: string type, your-access-key-secret.
      • ossConfig.servers.bucket: string type, your-bucket-name.
      • ossConfig.servers.secure: boolean type.
  • ftpConfig:
    Not required, if it doesn't exist, just a waring log will be printed to remind you.
    • ftpConfig.excludes:
      Array type, default is [], file extname in this array will not be uploaded. Extname needs to be prefixed with ., such as [".html"]. if ossConfig.includes is set, this will be invalid.
    • ftpConfig.includes:
      Array type, default is [], only file with extname in the array will be uploaded. Extname needs to be prefixed with ., such as [".html"]. if this is set, ossConfig.excludes will be invalid.
    • ftpConfig.servers:
      Default is null, if you want to use ftp server, you must be set it.
      • ftpConfig.servers.<CUSTOM_ENV_NAME>:
        Key name is custom env name, such test, pre-release or prod. Run the command will use it. This value is an array, because an environment may have multiple servers.
      • ftpConfig.servers.<CUSTOM_ENV_NAME>[index].host: encrypt-host.
      • ftpConfig.servers.<CUSTOM_ENV_NAME>[index].port: encrypt-port.
      • ftpConfig.servers.<CUSTOM_ENV_NAME>[index].username: encrypt-username.
      • ftpConfig.servers.<CUSTOM_ENV_NAME>[index].password: encrypt-password.
      • ftpConfig.servers.<CUSTOM_ENV_NAME>[index].remote_path: is an array, encrypt-remote-path.

All ftp servers config like host, port will be decrypted by <DECRYPT_KEY>, so we need to encrypt them first before writing the configuration file.

The encrypt algorithm is very simple, you can see the file src/utils/crypto.js in the source code. Encrypt via the command line may be provided in the future.