Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spex

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spex - npm Package Compare versions

Comparing version 0.0.31 to 0.0.33

API/batch.md

60

gruntfile.js
"use strict";
var fs = require("fs");
var mdFile = "API.md";
var files = [
{
src: "lib/index.js",
dest: "API/module.md"
},
{
src: "lib/ext/batch.js",
dest: "API/batch.md"
},
{
src: "lib/ext/page.js",
dest: "API/page.md"
},
{
src: "lib/ext/sequence.js",
dest: "API/sequence.md"
}
];
// Automatic links:
var links = {
"mixed value": "https://github.com/vitaly-t/spex/wiki/Mixed-Values",
"mixed values": "https://github.com/vitaly-t/spex/wiki/Mixed-Values"
};
module.exports = function (grunt) {

@@ -13,4 +37,3 @@ grunt.initConfig({

},
src: "lib/**/*.js",
dest: mdFile
files: files
}

@@ -25,8 +48,2 @@ }

// Automatic links:
var links = {
"mixed value": "https://github.com/vitaly-t/spex/wiki/Mixed-Values",
"mixed values": "https://github.com/vitaly-t/spex/wiki/Mixed-Values"
};
//////////////////////////////////////////////////////////

@@ -36,13 +53,20 @@ // Replaces all `$[link name]` occurrences in file API.md

function fixLinks() {
var done = this.async();
fs.readFile(mdFile, "utf-8", function (_, data) {
data = data.replace(/\$\[[a-z0-9\s]+\]/gi, function (name) {
var sln = name.replace(/\$\[|\]/g, ''); // stripped link name;
if (sln in links) {
return "<a href=\"" + links[sln] + "\">" + sln + "</a>"
}
return name;
var done = this.async(), count = 0;
files.forEach(function (f) {
fs.readFile(f.dest, "utf-8", function (_, data) {
data = data.replace(/\$\[[a-z0-9\s]+\]/gi, function (name) {
var sln = name.replace(/\$\[|\]/g, ''); // stripped link name;
if (sln in links) {
return "<a href=\"" + links[sln] + "\">" + sln + "</a>"
}
return name;
});
fs.writeFile(f.dest, data, check);
});
fs.writeFile(mdFile, data, done);
});
function check() {
if (++count === files.length) {
done();
}
}
}
{
"name": "spex",
"version": "0.0.31",
"version": "0.0.33",
"description": "Specialized Promise Extensions",
"main": "lib/index.js",
"scripts": {
"test": "istanbul cover ./node_modules/jasmine-node/bin/jasmine-node test --captureExceptions && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"test-only": "jasmine-node test",
"test": "jasmine-node test",
"coverage": "istanbul cover ./node_modules/jasmine-node/bin/jasmine-node test",
"doc": "./node_modules/.bin/jsdoc -c jsDoc.json"
"travis": "istanbul cover ./node_modules/jasmine-node/bin/jasmine-node test --captureExceptions && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},

@@ -41,5 +40,4 @@ "homepage": "https://github.com/vitaly-t/spex",

"istanbul": "0.3",
"jasmine-node": "1.x",
"jsdoc": "3.x"
"jasmine-node": "1.x"
}
}

@@ -6,3 +6,11 @@ # Specialized Promise Extensions

This project is a work-in-progress, but you already can try it:
This project is a work-in-progress, and I'm currently working on tests + [API documentation](API/index.md)
But you already can try the methods implemented:
* [batch]
* [sequence]
* [page]
### Usage
```

@@ -21,18 +29,4 @@ $ npm install spex

Methods implemented: [batch], [page] and [sequence].
### Stage 1: Formulating the protocol
This one is DONE! :)
### Stage 2: Implementation
This one is DONE! :)
### Stage 3: Tests + Documentation
Currently working on the [API documentation](API.md)
[batch]:API.md#batch
[page]:API.md#page
[sequence]:API.md#sequence
[batch]:API/batch.md
[page]:API/page.md
[sequence]:API/sequence.md

@@ -51,4 +51,2 @@ 'use strict';

// Doesn't pass, because the current batch implementation doesn't
// handle a promise from the callback.
describe("callback reject", function () {

@@ -55,0 +53,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc