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

software-template

v1.2.8

Published

Application template for web/mobile/pc/server/plugin.Buildin tamplate such as React/Flutter/Electron/Koa/ChromeExtension and more.

Downloads

79

Readme

Software-Template

简介

是 software-cli 功能扩展包,主要负责项目文件生成,内置项目模板如下(持续更新迭代升级):

  1. WEB: React/Vue
  2. Mobile: 微信小程序/Flutter
  3. PC: Electron
  4. Server: NodeJS
  5. Plugins: ChromeExtension/BabelPlugin/ESLintPlugin/VSCodeExtension

单独使用

step1:安装
  npm i software-template --save-dev
step2: 引用模块
  const { Creator } = require('software-template');
step3: 调用API
Creator.createProject('js', path.join(process.cwd(), 'z-test', 'test-a'));//创建项目

let file = path.join(process.cwd(), "z-test", "test-b", "src", "route", "index.jsx");
Creator.addCode(file, "//@mark_route_import", `const Demo = lazy(() => import("@view/demo/demo"));`);//标记处插入代码
function test(){
  console.log("run test()")
}
Creator.addCode(file, 10, test.toString());//第10行插入代码

API 说明

  1. createProject(projStack:String, root:String,projName:String) 创建项目

    
    projStack:项目技术栈,只能传入以下值其中之一,'js', 'ts', 'react', 'vue', 'wxext', 'electron', 'koa', 'chromeext', 'vscodeext'
    root:即将创建项目目录的父目录,传入绝对路径
    projName:项目名称
  2. addCode(filePath: String, mark: String|Number, text: String) 给指定路径的文件插入代码

    filePath:文件路径
    mark:文件中已存在的自定义标记或行号
    text:代码文本

应用包

所有应用包的 UI 框架需要自行添加,不做集成。

app-js

原生 JS 应用项目模板,通常用在使用 ES 编写 JS SDK 的场景中。

app-ts(暂未发布)

TS 应用项目模板,通常用在使用 TypeScript 编写 JS SDK 的场景中。

app-react

React 应用项目基础模板,React18 + redux5。

app-Vue(暂未发布)

Vue 应用项目基础模板,react3 + vuex4。

app-electron

Electron 应用项目模板,默认集成 react 框架。

app-flutter(暂未发布)

Flutter 应用项目模板

app-wxext(暂未发布)

微信小程序应用项目模板,采用小程序容器技术实现。

版本说明

  1. 1.1.0 删除原有的 MPA 应用模式,推荐使用模块联邦创建子应用;新增 electron 项目支持;
  2. 1.2.0 修改 API createProject;增加 API addCode;