# youjs

> YouJS: A now.js inspired library for syncing functions between node.js server and web/node.js clients using socket.io

Latest version **0.0.7** (published 2013-11-23) · 0 weekly downloads

## Install

```sh
npm install youjs
pnpm add youjs
yarn add youjs
bun add youjs
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2013-11-23 |
| First published | 2012-11-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= v0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | mofux |
| Maintainers | mofux |

## Links

- npm: https://www.npmjs.com/package/youjs
- Repository: https://github.com/mofux/youjs
- Issues: https://github.com/mofux/youjs/issues
- npm.io page: https://npm.io/package/youjs

## Dependencies (1)

- [socket.io](https://npm.io/package/socket.io.md) >= 0.8.7

## Recent versions

- 0.0.7 (latest) — 2013-11-23
- 0.0.6 — 2013-03-23
- 0.0.5 — 2012-11-24
- 0.0.4 — 2012-11-22
- 0.0.3 — 2012-11-22
- 0.0.2 — 2012-11-21
- 0.0.1 — 2012-11-15

## README

youjs
=====

now.js inspired library for syncing functions between node.js server and web/node.js clients using socket.io

Usage
=====

Install From npm
----------------

`npm install youjs` or `npm install youjs -g` to install globally



YouJS is a Node.js module. The client javascript (you.js) is served by the YouJS server.


YouJS uses the excellent <a href="https://github.com/LearnBoost/Socket.IO-node">socket.io</a> library.

Setup
==============

**1. On the server**


    var httpServer = require('http').createServer(function(req, response){ /* Serve your static files */ })
    httpServer.listen(8080);

    var youjs = require("youjs");
    var you = new youjs(httpServer);
    var everyone = you.everyone;

    everyone.you.logStuff = function(msg){
        console.log(msg);
    }

**2. On the client**
<pre><code>
&lt;script type="text/javascript" src="/youjs/you.js">&lt;/script>

&lt;script type="text/javascript"&gt;
  you.ready(function(){
    // "Hello World!" will print on server
    you.logStuff("Hello World!");
  });
&lt;/script>
</code></pre>

---
_Source: https://npm.io/package/youjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
