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

fed3

v0.1.4

Published

Development tool for web, support http server and freemarker.js and http proxy.

Downloads

7

Readme

FED - The Front-End Develop Kitchen

Join the chat at https://gitter.im/ijse/FED

方便内部用最新版 fed,发布 fed3 到 npm 仓库

FED 是一个前端开发环境,供前端编写简单的后台接口,以调试开发页面; 前端可以在此环境下,使用真实的URL访问地址访问,并可嫁接于其它服务器调试页面(调试线上代码), 可以写页面模板代码并使用测试数据调试输出,最终可生成文档。

FED 试图重新划分项目开发中前后端分工,明确各开发范围,提高项目并行开发效率,降低前后端开发的耦合度;同时为前端开发提供了可测的工具平台,使之在无后端实现情况下也可模拟后端接口及数据,测试页面功能。

Build Status

Features

  • 支持FreeMarker模板引擎
  • 支持标准的HTTP请求方法及返回数据格式
  • 支持less、coffee文件的实时编译
  • 可自动重启应用最新代码
  • *插件机制扩展,满足大部分扩展需求

Quick Start

  1. 创建项目文件夹:
$> mkdir fedProj
  1. 下载安装FED:
$> npm install -g fed3
  1. 创建如下目录:
- /fedProj
  - mock
  - view
  1. 启动服务:
$> fed3 server -p 3000 -M mock --view-root view ./fedProj
  • -p 3000 http监听端口号, 默认为3000
  • -M mock mock folder, 每个文件是一个connect的middleware, mock相对于./test/res
  • --view-root view freemarker 的模板文件夹
  • ./test/res 项目web根目录

Useful Tips

  • Mock Mapping file

mock文件夹下创建一个文件名为_map的文件,内容如下:

/a testA.js
/b testB.js

则请求http://localhost:3000/a会使用testA.js mock文件。

  • Global Variables File

mock文件夹下创建一个文件名为_globals.json的文件,内容为json:

{
  "appName": "FED"
}

则在所有view中都可以获取到以上变量。

  • Proxy Redirect

/fedProj根下创建名为proxylist.json的文件,内容如:

{
  "/search": "http://www.aaa.com"
}

则在请求http://localhost:3000/search时,会代理请求http://www.aaa.com/search

Help Manual


$> fed3 help

  Usage: fed [options] [command]


  Commands:

    server      Launch local http service with serve2
    help [cmd]  display help for [cmd]

  Options:

    -h, --help      output usage information
    -V, --version   output the version number
    -v, --versions  output current fed version

$> fed3 server -h

  Usage: fed3 server [options] [dir]

  Options:

    -h, --help                output usage information
    -V, --version             output the version number
    -a, --auth <user>:<pass>  specify basic auth credentials
    -F, --format <fmt>        specify the log format string
    -p, --port <port>         specify the port [3000]
    -H, --hidden              enable hidden file serving
    -S, --no-stylus           disable stylus rendering
    -J, --no-jade             disable jade rendering
        --no-less             disable less css rendering
    -I, --no-icons            disable icons
    -L, --no-logs             disable request logging
    -D, --no-dirs             disable directory serving
    -f, --favicon <path>      serve the given favicon
    -M, --mocks <path>        mock files directory
        --cookies             add cookies parse support
    -C, --cors                allows cross origin access serving
        --compress            gzip or deflate the response
        --exec <cmd>          execute command on each request

如果有任何问题请到【issues】给我提issue,我会尽快处理并答复的。

Contributing

点右上角fork按钮

Test

> npm test

License

(The MIT License)

Copyright (c) 2011 ijse;

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.