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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sky-webgis

v0.1.0

Published

对 openlayer 操作 arcgis 的封装。

Downloads

12

Readme

简介

对 openlayer 操作 arcgis 的封装。

开发环境

JavaScript 与 TypeScript 代码的打包的基础环境。

  • rollup 打包 es/cjs 模块
  • eslint 校验代码
  • babel 编译 es6+/ts 代码
  • karma-webpack/jasmine 单元测试

目录

|- build 进行生产的配置文件
  |- alias.js 路径别名配置
  |- build.js 打包脚本
  |- config.js 打包配置
  |- rollup.config.js rollup 基本配置
|- dist 打包输出
  |- *.common.js commonjs 模块
  |- *.esm.js es 模块
|- src 源文件
|- stat 包体积分析(html直接打开)
|- test 测试
  |- unit 单元测试
    |- modules 所有的测试模块
    |- index.js 测试模块的入口文件
    |- karma.config.js karma 配置文件
|- types ts 类型声明文件
|- .editorconfig 编辑器配置文件
|- .eslintignore eslint 忽略目录配置文件
|- .eslintrc.js eslint 配置文件
|- babel.config.js babel 配置文件

API

注册投影坐标系

export declare type ProjectionRegisterResult = {
  code: string;
  bbox: number[];
  unit: string;
  proj4: string;
  area: string;
  name: string;
}[];
/**
 * 注册 projection
 * 通过在线查询获取 proj4 值
 * @link https://epsg.io
 * @param code 例如:4523/4990
 */
export declare function projectionRegister(
  code: string | number
): Promise<ProjectionRegisterResult>;
/**
 * 批量注册 projection
 * @link https://epsg.io
 * @param codes 例如:[4523,4990]
 */
export declare function projectionRegisterMultiple(
  codes: (string | number)[]
): Promise<ProjectionRegisterResult>;

// example
projectionRegister(4523).then(res => {
  console.log(res); // ProjectionRegisterResult
  // 注册成功
});
projectionRegisterMultiple([4523, 4527]).then(res => {
  console.log(res); // ProjectionRegisterResult
  // 注册成功
});

开发

  • src/ 下开发 JS/TS 模块,例如:example.ts
  • test/unit 下创建单元测试文件,例如:example.spec.ts(必须带 spec.ts/js 后缀)
  • 引入 example.ts 中的内容编写单元测试
  • 运行命令 npm test 进行测试,然后发现问题进行回归

如果需要 debug,请关闭 test/unit/karma.config.js 中的 singleRun 选项。

发布

  • build/config.js 中配置入口文件,例如上面的 example.ts
const multiOption = [
  {
    // 入口
    input: "src/example.ts",

    // 创建输出配置
    // createOutputOptions 函数传入参数为输出的文件名
    output: createOutputOptions("example")
  }
];
  • 运行命令 npm run build 进行打包
  • 运行命令 npm publish 发布包(需要登陆 npm)
  • 或上传 dist 目录

注意事项

  • 项目根目录配置了简写路径,路径名为 package.jsonname 属性,方便外部引用。 配置其他的参考 build/alias.jstsconfig.json 中的 paths 参数。