Popular Javascript Libraries
For both frontend and backend
15 flashcards · Programming Languages · by lakesare
What is npm install agenda package for?
A light-weight job scheduling library for Node.js.
What is npm install agendash package for?
Optional standalone web-interface for agenda.
What is npm install ajv package for?
Validates JSON according to some schema, e.g.: var schema = { "properties": { "foo": { "type": "string" }, "bar": { "type": "number", "maximum": 3 } } }; import Ajv from 'ajv'; const ajv = new Ajv(); const valid = ajv.compile(schema)({ "foo": 2, "bar": 4 }); if (valid){ console.log('Valid!'); } else { console.log(validate.errors); } //=> data.foo should be string, data.bar should be <= 3" Ajv: Another JSON Schema Validator
What is npm install sinon package for?
JavaScript test spies, stubs and mocks. it('calls the original function only once', () => { const callback = sinon.fake(); const rrr = once(callback); rrr(); rrr(); assert.equals(callback.callCount, 1); });
What is npm install nightwatch package for?
End-to-end tests in Node.js which run against a Selenium/WebDriver server.
What is npm install newrelic package for?
Lets you see the performance of your production app.
What is npm install dexie package for?
Dexie.js is a wrapper library for IndexedDB - the standard database in the browser. import Dexie from 'dexie'; const db = new Dexie("FriendDatabase"); // Declare tables, IDs and indexes db.version(1).stores({ friends: '++id, name, age' }); db.transaction('rw', db.friends, async() => { // Make sure we have something in DB: if ((await db.friends.where({name: 'Josephine'}).count()) === 0) { const id = await db.friends.add({name: "Josephine", age: 21}); alert (`Addded friend with id ${id}`); } // Q…
What is npm install dexie-mongoify package for?
Mongoify tries to provide MongoDB-like query language for Dexie.
What is npm install winston package for?
That's a logging library. const logger = winston.createLogger({ transports: [ new winston.transports.Console(), new winston.transports.File({ filename: 'combined.log' }) ] }); logger.info('Hello again distributed logs');
What is npm install popper.js package for?
Common examples of poppers are tooltips, popovers, and drop-downs. Popper.js is a positioning engine, its purpose is to calculate the position of an element to make it possible to position it near a given reference element.
What is npm install mjml package for?
It's for building responsive emails (like Foundation for Emails)
What is npm install nodecredstash package for?
It's for keeping app's secret variables, uses AWS Key Management Service (KMS). var credstash = new Credstash({table: 'credstash', awsOpts: {region: 'us-east-1'}}); credstash.getAllSecrets().then(function(secrets) { global.secrets = secrets; });
What is npm install webpack-isomorphic-tools package for?
Legacy! For new projects use either universal-webpack or all-in-one frameworks like Next.js. Small helper module providing basic support for isomorphic (universal) rendering when using Webpack. webpack-isomorphic-tools mimics (to a certain extent) Webpack's require() magic when running application code on a Node.js server without Webpack. It basically fixes all those require()s of assets and makes them work instead of throwing SyntaxErrors. It doesn't provide all the capabilities of Webpack (fo…
What is npm install assets-webpack-plugin package for?
It emits /webpack-assets.json that output asset urls: { "javascript": { "main": "http://localhost:3001/static/main-fc5ad393e9cb69a7cc42.js", "onboarding": "http://localhost:3001/static/onboarding-fc5ad393e9cb69a7cc42.js", "package_management": "http://localhost:3001/static/package_management-fc5ad393e9cb69a7cc42.js" }, depending on the webpack's entries: module.exports = { devtool: 'source-map', context: path.resolve(__dirname, '..'), entry: { 'main': [ 'event-source-polyfill', 'webpack-hot-mid…
Why will webpack application crash when tried to be run in Node.js?
Ok, then one can just go ahead and run the web application in Node.js and its done. But, there's one gotcha: a Webpack application will usually crash when tried to be run in Node.js straight ahead (you'll get a lot of SyntaxErrors with Unexpected tokens). The reason is that Webpack introduces its own layer above the standard javascript. This extra layer handles all require() calls magically resolving them to whatever it is configured to. For example, Webpack is perfectly fine with the code requ…