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

faban-npm-public

v1.0.4

Published

A Vue component library with utils.

Downloads

10

Readme

faban-npm-public

faban-npm-public 是一个 Vue 的 npm 库,包含常用的 hooks、组件和工具函数,方便在多个项目中复用。

安装

你可以使用 npm 或 Yarn 来安装这个包:

使用 npm

npm install faban-npm-public

使用 Yarn

yarn add faban-npm-public

使用

导入组件

安装后,你可以在项目中使用库中的组件和 hooks。以下是如何使用 MyComponentuseCounter 的示例:

使用组件

<template>
  <div>
    <MyComponent />
  </div>
</template>

<script>
import { MyComponent } from 'faban-npm-public';

export default {
  components: {
    MyComponent,
  },
};
</script>

使用 hooks

你也可以使用库中封装的 hooks,如 useCounter

<template>
  <div>
    <h1>Counter: {{ count }}</h1>
    <button @click="increment">Increment</button>
    <button @click="decrement">Decrement</button>
    <button @click="reset">Reset</button>
  </div>
</template>

<script>
import { useCounter } from 'faban-npm-public';

export default {
  setup() {
    const { count, increment, decrement, reset } = useCounter(0);

    return {
      count,
      increment,
      decrement,
      reset,
    };
  },
};
</script>

自定义 Hooks 示例

下面是如何使用自定义的 useCounter hooks:

import { useCounter } from 'faban-npm-public';

const { count, increment, decrement, reset } = useCounter(10);

样式使用

如果库中包含了全局样式或 SCSS 文件,可以在项目中直接导入:

import 'faban-npm-public/dist/style.css';

贡献

欢迎提交问题和贡献代码。如果你有任何建议或改进,请在 GitHub 上提交 pull request 或 issue。

许可证

本项目采用 MIT 许可证,详情请查看 LICENSE 文件。


### 2. **确保 `README.md` 随包发布**

确保你的 `README.md` 文件位于项目根目录中,并且在发布 npm 包时,它会自动包含在包中。

你可以通过以下命令发布 npm 包:

```bash
npm publish

一旦发布成功,README.md 的内容会出现在 npm 包的主页上,供用户查看。

3. 测试并更新文档

发布之后,检查 npm 包页面上的文档展示效果。如果需要更新,可以修改 README.md 文件并重新发布。