0

Are there any libraries or frameworks that allow me to work with mongodb and nodejs that don't require a npm install ? More precisely I'm working on windows.For example i managed to find a library for working with websockets(https://github.com/ncr/node.ws.js) and simply requires you to include the file.

Is it absolutely necessary to use a library ? I am asking because all the tutorials use one, doesn't node have a module for this ?

1
  • You can install most modules from the source merely by git cloning them Commented Aug 20, 2011 at 11:33

4 Answers 4

5

You don't need npm to use most modules - you can download them (e.g. from their GitHub page as a zip file) and then put them in your project folder. Then require them:

var mongodb = require('../lib/module-folder-name');

Some useful libraries:

MongoDB native driver: https://github.com/christkv/node-mongodb-native

Mongoose, a higher level ORM for MongoDB: https://github.com/learnboost/mongoose/

Sign up to request clarification or add additional context in comments.

4 Comments

and for example how can i use the expressjs or mongoose frameworks ? Can I include them as well ?
when i include express.js and try starting the server i get an error saying Cannot find module connect
Express has a few dependencies such as Connect. NPM makes this easy as it manages the dependencies for you but as you're not using it you'll need to install the dependencies yourself. Open the package.json file and it will list the dependencies
I managed to get some modules to work but for example express doesn't seem to be working with node 0.5.x because of the connect module that it relies on.
1

evilcelery has the best answer +1 from me;

Most anything you run across for npm will work just as he said, and lib is the best convention to do it with.

To expand on his links a bit The module list he refereed to is found: https://github.com/joyent/node/wiki/modules

http://search.npmjs.org/ is a bit more user-friendly.

Also if you wish to include things globally similar to npm you can do what it does with things like html and put it in the lib dir where you originally compiled it with the Makefile (note: you may not need to rebuild it but I beleave you do)

There are a lot of mongodb related projects/libs enjoy!

interestingly:

Blockquote Contrary to the belief of many, "npm" is not in fact an abbreviation for "Node Package Manager". It is a recursive bacronymic abbreviation for "npm is not an acronym".

source: https://github.com/isaacs/npm/blob/master/doc/faq.md#readme

Comments

0

You can use builtin net.sockets module

var net = require('net');
var server = net.createServer(); // to listen
var socket = net.socket; // to connect

It might you to work with any network application and write raw requests.

A lot of modules written on js so you can not to install them with npm, but require from your project folder.

Comments

0

I haven't tried it, but this should enable you to get node packages with windows: https://github.com/japj/ryppi . It will require you to download Python.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.