A collection of JavaScript/TypeScript libraries for Angular applications.
JS-Libs is a monorepo containing reusable Angular libraries developed by Felipe Desiderati. These libraries provide various functionalities to enhance Angular applications.
-
Install Node and NPM. Ensure Node.js and
npmare installed on your machine. If not, download and install them from Node.js official website. -
Configuring
npmfor the private repository. Execute this login command:npm login --registry https://api.repoflow.io/npm/desiderati/js-libs --auth-type legacy
-
Publishing artifacts. Navigate to your package directory in the terminal and execute:
npm publish --registry https://api.repoflow.io/npm/desiderati/js-libs
This prepares npm to publish packages to your specified private repository.
An Angular service wrapper for the atmosphere.js library, providing WebSocket and long-polling communication capabilities for Angular applications.
- WebSocket communication with automatic fallback to long-polling
- Reconnection handling
- Observable-based API for reactive programming
- Simple message sending interface
npm install @desiderati/[email protected]import {AtmosphereService} from '@desiderati/atmosphere';
import {Notification} from '@desiderati/atmosphere';
@Component({
// ...
})
export class YourComponent {
constructor(private atmosphereService: AtmosphereService) {
}
connect() {
this.atmosphereService.connect('https://your-server.com/endpoint')
.subscribe({
next: (msg: string) => {
console.log('Received message:', msg);
// Handle the message
},
error: (err: any) => {
console.error('Connection error:', err);
// Handle the error
}
});
}
sendMessage() {
const notification = new Notification('Your client (user) identification', 'Your message');
this.atmosphereService.sendNotification(notification);
}
}For more details, see the Atmosphere Library.
To build all libraries in the monorepo:
ng buildTo build a specific library (e.g., atmosphere):
ng build atmosphereTo run tests for all libraries:
ng testTo run tests for a specific library:
ng test atmosphereAfter building a library, you can publish it to npm:
cd dist/atmosphere
npm publishFelipe Desiderati [email protected] (https://github.com/desiderati)