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

bitorjs

v0.0.37

Published

> React & vue & node 插件式开发工具包

Downloads

153

Readme

bitorjs

bitorjs 可以帮助开发者更好地在 VUE & NODE 项目中快速集成插件式开发等功能

使用方法见文档

安装

npm i -S bitorjs

Bitorjs 做了什么

  • 统一了项目目录划分
  • 统一了配置方式
  • 统一了中间件定义及使用
  • 统一的 service 及 Mock
  • 统一采用 webpack 去中心化 require.context 进行目录监听
  • 统一使用注解进行路由注入
  • 统一使用 webpack 进行代码处理

为什么要选择 Bitorjs

  • 让项目迅速具有插件式插件功能
  • 让你使用注解式路由
  • 可与 node 开发统一开发习惯
  • 增加前端 中间件 功能
  • service 与 mock 切换更方便

以上功能是能想到的, 更多功能及作用等你解锁

vue中使用

创建 项目

使用 vue 官方脚手架 vue-cli

  $ vue init webpack xxx
安装依赖
  $ npm install -S bitorjs
  $ npm install -S vuex vuex-persist
  $ npm install -D babel-plugin-transform-decorators-legacy


  and add the following line to your .babelrc file:
  {
    "plugins": ["transform-decorators-legacy"]
}
修改
  1. 创建文件 config/index.env.js

  2. 修改文件 src/main.js

  3.  // The Vue build version to load with the `import` command
     // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
     import Vue from 'vue'
     import Application from 'bitorjs/vue';
     import App from './App'
    
     Vue.config.productionTip = false
    
     new Application({}, App, "#app").start(app => {
       app.watch(require.context('../config', false, /\.js$/))
       app.watch(require.context('.', true, /^((?!\/view\/).)+\.(vue|js)$/));
     })
             
  4. 修改文件 src/router/index.js

  5.  import {
       Get,
       Controller
     } from 'bitorjs'
    
     import HelloWorld from '@/components/HelloWorld'
    
     @Controller('/')
     export default class {
       @Get('/')
       async index(ctx){
         ctx.render(HelloWorld)
       }
     }

到此, 改造完毕, 接下来,你就可以 开启 bitorjs 之旅