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

@iyowei/create-templates

v1.0.16

Published

统一提供模板,额外提供与模板紧密相关、有用的帮助函数。无论是创建 Cli、React、Node、Vue、Electron 等等之中的哪一个项目,都会需要用到模板,而这些模板文件也大都相同,小异可以维护在各自专门的脚手架中。

Downloads

8

Readme

@iyowei/create-templates

统一提供模板,额外提供与模板紧密相关、有用的帮助函数。无论是创建 Cli、React、Node、Vue、Electron 等等之中的哪一个项目,都会需要用到模板,而这些模板文件也大都相同,小异可以维护在各自专门的脚手架中。

使用

copiers

  • 返回 { Object } 纯粹 “拷贝” 用途的模板文件
    • common { Array } 通用用途文件列表
    • eslintrc { Object } ESlint 配置模板文件列表
      • esm ESM 模块用途的 ESlint 配置
    • mocha { String } mocha.js 配置文件模板
    • benchmark { String } 文件脚本
import { log } from 'console';
import { copiers } from '@iyowei/create-templates';

log(copiers);

/**
 * {
 *   common: [
 *     '/Users/iyowei/Development/iyowei/create-templates/src/.vscode',
 *     '/Users/iyowei/Development/iyowei/create-templates/src/.editorconfig',
 *     ...
 *   ],
 *   esm: [
 *     ...
 *   ],
 *   ...
 * ]
 */

prints

import { log } from 'console';
import { prints } from '@iyowei/create-templates';

log(prints);

/**
 * {
 *   readme: '/Users/iyowei/Development/iyowei/create-templates/src/README.md',
 *   npmrc: '/Users/iyowei/Development/iyowei/create-templates/src/.npmrc',
 *   ...
 * }
 */

stockrooms

import { log } from 'console';
import { stockrooms } from '@iyowei/create-templates';

log(stockrooms);

/**
 * {
 *   gitignore: '/Users/iyowei/Development/iyowei/create-templates/src/gitignore',
 *   ...
 * }
 */

writeGitignoreSync({ output, topics })

在指定位置生成包含指定主题内容的 .gitignore 文件。

  • output { String } 输出位置,包含输出文件名,例如:/Users/iyowei/Development/iyowei/.gitignore
  • topics { Array | String } github/gitignore 里模板文件的文件名,单个或者集合
import { writeGitignoreSync } from '@iyowei/create-templates';

writeGitignoreSync({
  output: join(process.cwd(), '.gitignore'),
  topics: [
    'macOS',
    'Windows',
    'Linux',
    'Node',
    'VisualStudioCode',
    'SublimeText',
    'CVS',
    'Diff',
    'Vim',
    'TortoiseGit',
  ],
});

writeGitignore({ output, topics })

异步方法,在指定位置生成包含指定主题内容的 .gitignore 文件。

  • output { String } 输出位置,包含输出文件名,例如:/Users/iyowei/Development/iyowei/.gitignore
  • topics { Array | String } github/gitignore 里模板文件的文件名,单个或者集合
import { writeGitignore } from '@iyowei/create-templates';

(async () => {
  await writeGitignore({
    output: join(process.cwd(), '.gitignore'),
    topics: [
      'macOS',
      'Windows',
      'Linux',
      'Node',
      'VisualStudioCode',
      'SublimeText',
      'CVS',
      'Diff',
      'Vim',
      'TortoiseGit',
    ],
  });
})();

writeNpmRcSync({ output, data })

串行方法,在指定位置生成 .npmrc 文件。

  • output { String } 输出位置,包含输出文件名,例如:/Users/iyowei/Development/iyowei/.npmrc
  • data { Object} 用来填充模板的数据
import { writeNpmRcSync } from '@iyowei/create-templates';

writeNpmRcSync({
  output: join(process.cwd(), '.npmrc'),
  data: { namespace: 'iyowei' },
});

writeNpmRc({ output, data })

异步方法,在指定位置生成 .npmrc 文件。

  • output { String } 输出位置,包含输出文件名,例如:/Users/iyowei/Development/iyowei/.npmrc
  • data { Object} 用来填充模板的数据
import { writeNpmRc } from '@iyowei/create-templates';

(async () => {
  await writeNpmRc({
    output: join(process.cwd(), '.npmrc'),
    data: { namespace: '' },
  });
})();

writeReadmeSync({ output, data })

串行方法,在指定位置生成 README.md 文件。

  • output { String } 输出位置,包含输出文件名,例如:/Users/iyowei/Development/iyowei/README.md
  • data { Object} 用来填充模板的数据
import { writeReadmeSync } from '@iyowei/create-templates';

writeReadmeSync({
  output: join(process.cwd(), 'README.md'),
  data: {
    name: 'iyowei',
    description: 'balabala...',
  },
});

writeReadme({ output, data })

异步方法,在指定位置生成 README.md 文件。

  • output { String } 输出位置,包含输出文件名,例如:/Users/iyowei/Development/iyowei/README.md
  • data { Object} 用来填充模板的数据
import { writeReadme } from '@iyowei/create-templates';

(async () => {
  await writeReadme({
    output: join(process.cwd(), 'README.md'),
    data: {
      name: 'iyowei',
      description: 'balabala...',
    },
  });
})();

安装

Node Version Badge esm

NPM

npm add @iyowei/create-templates

PNPM

pnpm add @iyowei/create-templates

Yarn

yarn add @iyowei/create-templates

参考

".github" 文件夹

参与贡献

PRs Welcome

其它

"@iyowei/create-templates" 使用 @iyowei/create-esm 脚手架生成。