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 🙏

© 2024 – Pkg Stats / Ryan Hefner

downtolocal

v1.0.12

Published

Change online resources to local resource references

Downloads

2

Readme

downtolocal

npm npm Travis (.org) GitHub

English | 简体中文

Introduction

downtolocal —— It is a tool to change online resources to local resource references. Usually, in the work, the reference to static resources is through CDN, but it is also possible that CDN needs to be replaced in batches (such as uncontrollable factors such as domain name is about to expire, or project ideas) Local deployment), urgent processing, but too many resources, each right-click to save is really hard, so this tool was born.

Use

  • REG:The resource regular to be replaced (image, css, js, etc.);
  • BIT:Take the number of HASH bits, mainly to distinguish between the same file name in the same project, but not the same file;
  • CDNRULE:HASH;
LOCMAP = {
      searchPath: "/example", From which location to start searching, string
      //files: [".html",".css",".phtml",".md",".vue",".sass",".scss",".less",".js"], The file type to match
      files: [], Default is empty
      If the array is empty, it will scan all types of files. If you don't know what type of files, it is recommended, but it will scan a lot of unnecessary files, such as images, fonts, media resources, etc. There is no distinction here because there are too many types.
      Specify the file type if you want to match the file type you want to match
      destLocPath: path.join(__dirname, "example/www/static/localres/") The location where the matched resource is stored
}
EXCLUDETARGET = {
      path:["config","pub.html"],
      //path:[], Default is empty,Accurate to file or directory
      keyword:['node_modules','demo'] 
      //keyword:[] Default is empty,Accurate to path keywords, case sensitive For example: /node_modules/ Unlimited level
 }
node q.js

Description

  • 1.Under the same level, the directories and file names named the same name will not be overwritten by each other. After the directory is created, it will be appended to the corresponding directory (Ep:demo directory and demo.html)
  • 2.The script should be placed in the outer layer to match the directory
  • 3.In a project directory, files named for the same file name, if found to have the same name when matching, will use the hash value in the CDN to distinguish
  • 4.This tool is not used as a business dependency. After downloading, please configure the above related parameters to use. The package contains, for example, a directory as a demonstration.

Optimization point

  • 1.Add matching all file functions
  • 2.Increase the directory exclusion function
  • 3.Compatible with windows/mac
  • 4.Differentiate file naming
  • 5.Increase timeout processing
  • 6.Increase the error log

License

MIT

Copyright (c) 2019-present jinchen