As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
# JS files | |
JS_FINAL = js/project-name-all.js | |
JS_TARGETS = js/file1.js \ | |
js/file2.js \ | |
js/file3.js | |
# CSS files | |
CSS_FINAL = css/project-name-all.css | |
STYLUS_TARGETS = css/file1.styl \ |
$ casperjs event.js | |
[info] [phantom] Starting... | |
[info] [phantom] Running suite: 3 steps | |
[debug] [phantom] Successfully injected Casper client-side utilities | |
[info] [phantom] Step 2/3 file:///Users/niko/Sites/casperjs/test.html (HTTP 0) | |
[debug] [phantom] start page is loaded | |
[info] [phantom] Step 2/3: done in 207ms. | |
[info] [phantom] Step 3/3 file:///Users/niko/Sites/casperjs/test.html (HTTP 0) | |
[info] [phantom] Step 3/3: done in 310ms. | |
[info] [phantom] Done 3 steps in 406ms |
/** | |
* An implementation for Quicksort. Doesn't | |
* perform as well as the native Array.sort | |
* and also runs the risk of a stack overflow | |
* | |
* Tests with: | |
* | |
* var array = []; | |
* for(var i = 0; i < 20; i++) { | |
* array.push(Math.round(Math.random() * 100)); |
(function() { | |
var server = require('webserver').create(); | |
var service = server.listen(9876, function (request, response) { | |
var fs = require('fs'); | |
var file = fs.read(fs.workingDirectory + request.url); | |
response.statusCode = 200; | |
response.headers['Content-Type'] = 'text/html'; | |
response.write(file); | |
response.close(); | |
}); |
#!/bin/bash | |
# | |
# PostgreSQL Backup Script Ver 1.0 | |
# http://autopgsqlbackup.frozenpc.net | |
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com> | |
# | |
# This script is based of the AutoMySQLBackup Script Ver 2.2 | |
# It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
# | |
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
/** | |
* Copyright 2012 Akseli Palén. | |
* Created 2012-07-15. | |
* Licensed under the MIT license. | |
* | |
* <license> | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files | |
* (the "Software"), to deal in the Software without restriction, | |
* including without limitation the rights to use, copy, modify, merge, |
var casper = require("casper").create(); | |
var url = "https://github.com/search?langOverride=VimL&language=&q=vimrc&repo=&type=Repositories&start_value=" + casper.cli.get(0); | |
var repoLinks = []; | |
var fileLinks = []; | |
function getRepoLinks() { | |
var links = []; | |
$("div.results .result h2 a").each(function(i,el){ | |
links.push(el.href); | |
}); |
Put test1.js
and test2.js
into a tests/
directory, then run the suite:
$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js
# this is test 1
Hi, I've been included.
PASS Subject is strictly true