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

@raojinlin/create-chrome-extension

v1.0.5

Published

Set up a chrome extension by running one command.

Downloads

3

Readme

Create Chrome Extension

@raojinlin/create-chrome-extension可以快速生成一个使用React和Ant Destign的Chrome扩展应用。

asciicast

命令行参数

usage: index.js [-h] [-v] [-p PACKAGE] [-d DESCRIPTION] [-e EXTENSION_NAME] [-x EXTENSION_DESCRIPTION] project-directory

Create chrome extension

positional arguments:
  project-directory

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -p PACKAGE, --package PACKAGE
                        Package name
  -d DESCRIPTION, --description DESCRIPTION
                        Package description
  -e EXTENSION_NAME, --extension-name EXTENSION_NAME
                        Extension name
  -x EXTENSION_DESCRIPTION, --extension-description EXTENSION_DESCRIPTION
                        Extension description

创建扩展应用

  1. 确保你的计算机上已经安装了Node.js的版本为16.0.0或更高版本。如果尚未安装,请访问Node.js官方网站(https://nodejs.org/)并按照指示安装。

  2. 打开终端或命令提示符,并使用以下命令创建一个新的Chrome扩展项目:

npx @raojinlin/create-chrome-extension my-extension

这将使用npx工具创建一个名为"my-extension"的新Chrome扩展项目。

或者使用参数一键创建Chrome扩展项目:

npx @raojinlin/create-chrome-extension my-extension --package MyChromeExtension --description 'My Chrome extension' --extension-name 'My Chrome Extension' --extension-description 'My Chrome Extension Description' 
  1. 在项目目录中,你可以开始编写扩展代码。首先,进入项目目录:
cd my-extension
  1. 创建你的React组件和扩展的其他页面。你可以在项目中的src目录中创建React组件,并根据需要创建其他页面。

  2. 修改Chrome扩展的清单文件(src/manifest.[env].json),以定义你的扩展的行为和设置。确保在清单文件中包括你的React页面。

  3. 构建你的React应用,以便将其包含在Chrome扩展中。使用以下命令构建React应用:

npm run build

这将生成一个extension文件夹,其中包含了打包后的React应用。

  1. 最后,使用Chrome浏览器的开发者模式加载你的扩展。打开Chrome浏览器,转到扩展管理页面(chrome://extensions/),启用"开发者模式",然后点击"加载已解压的扩展"并选择你项目中的extension文件夹。

你的Chrome扩展应用现在应该加载并在浏览器中可用。你可以根据需要进一步自定义和配置扩展的功能和外观。

请注意,这只是一个基本的创建Chrome扩展应用,具体的配置和功能取决于你的项目需求。你可能需要查阅Chrome扩展开发文档以深入了解如何定制你的扩展。

另外,生成的代码使用chrome-extension-react-antd-template模板。关于代码的开发请参考:README.md