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

tern-node-mongoose

v0.2.0

Published

A Tern plugin adding support for mongoose.

Downloads

4

Readme

tern-node-mongoose

Build Status npm version

tern-node-mongoose is a tern plugin which adds support for Mongoose to the JavaScript code intelligence system Tern.

Demo

You can see demo with CodeMirror (inside Web Browser) demos/mongoose.html :

CodeMirror & TernNodeMongoose

If you wish to use Eclipse as IDE, see Eclipse support for Node Mongoose.

Installation

tern-node-mongoose works with the NodeJS [Tern Server][tern-server], and within a browser.

The easiest way to install tern-node-mongoose is to use a recent version of [npm][npm]. In the directory where you installed the [tern package][tern-npm], simply run

$ npm install tern-node-mongoose

Configuration

node-mongoose tern plugin extends node tern plugin to support mongoose.

With Node.js

In order for Tern to load the tern-node-mongoose plugin once it is installed, you must include node-mongoose in the plugins section of your [Tern configuration file][tern-config] and node.

Here is a minimal example .tern-project configuration file:

{
  "ecmaVersion": 5,
  "plugins": {
    "node": {},
    "node-mongoose": {}
  }
}

With WebBrowser (CodeMirror)

See demos/mongoose.html

How to generate node-mongoose.js?

Introduction

The tern plugin node-mongoose.js is generated from the JavaScript sources of Mongoose. Process of this generation is :

  • generate a JSON Representation (api.json) of JavaScript sources of Mongoose by using dox.
  • generate a JSON Type Definition from the generated dox JSON Representation.
  • generate the tern plugin by using the generated JSON Type Definition.

Instruction

Here the steps :

  • open cmd

  • cd $HOME/tern-node-mongoose

  • npm install (to install dox)

  • Generate generator/data/api.json from JS sources with dox :

    • edit generator/data/node/js2api_mongodb.js with the path of the node-mongoose :

      var basedir = "D:/_Projects/git/node-mongoose/"

    • launch the following command to generate generator/data/api.json :

      node generator/data/node/js2api_mongodb

  • Generate the tern plugin node-mongoose.js from api.json, by launching :

    node generator/node/make_plugin

Advanced informations

JS sources are sometimes NOT well annotated, so it misses some information (some return function, parameter type, etc). The generator/dox2tern_mongodb.js gives the capability to override information of JS sources.

If you wish to work on the dox JSON Representation (api.json) to tern JSON Type Definition, you can open the HTML page generator/html/dox2tern.html

See Contributing for more information

Structure

The basic structure of the project is given in the following way:

  • node-mongoose.js the tern plugin.
  • demos/ demos with node-mongoose tern plugin which use CodeMirror.