Permalink
Browse files

docs, package.json

  • Loading branch information...
substack committed Dec 28, 2012
1 parent d3e6c60 commit 554f9adb0e4699eb5865df440d16390f44c0386c
Showing with 103 additions and 0 deletions.
  1. +18 −0 LICENSE
  2. +37 −0 package.json
  3. +48 −0 readme.markdown
View
18 LICENSE
@@ -0,0 +1,18 @@
+This software is released under the MIT 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, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,37 @@
+{
+ "name" : "quotemeta",
+ "version" : "0.0.0",
+ "description" : "escape regular expression characters",
+ "main" : "index.js",
+ "bin" : {},
+ "directories" : {
+ "example" : "example",
+ "test" : "test"
+ },
+ "dependencies" : {},
+ "devDependencies" : {
+ "tap" : "~0.3.0"
+ },
+ "scripts" : {
+ "test" : "tap test/*.js"
+ },
+ "repository" : {
+ "type" : "git",
+ "url" : "git://github.com/substack/quotemeta.git"
+ },
+ "homepage" : "https://github.com/substack/quotemeta",
+ "keywords" : [
+ "regex",
+ "RegExp",
+ "escape",
+ "backslash",
+ "\\",
+ "quote"
+ ],
+ "author" : {
+ "name" : "James Halliday",
+ "email" : "mail@substack.net",
+ "url" : "http://substack.net"
+ },
+ "license" : "MIT"
+}
View
@@ -0,0 +1,48 @@
+# quotemeta
+
+escape regular expression metacharacters
+
+This module is like
+[perl's quotemeta](http://perldoc.perl.org/functions/quotemeta.html)
+without the part about `\Q...\E`.
+
+# example
+
+``` js
+var quotemeta = require('quotemeta');
+
+var query = new RegExp('\\d ' + quotemeta('node.js'));
+var filter = function (x) { return query.test(x) };
+
+var xs = [
+ '0 node^js y',
+ '1 node_js x',
+ '2 node.js 5',
+ '3 beep z',
+ 'X node.js Y',
+ '4 boop w'
+];
+console.dir(xs.filter(filter));
+```
+
+# methods
+
+``` js
+var quotemeta = require('quotemeta')
+```
+
+## var escaped = quotemeta(string)
+
+Return `string` with metacharacters escaped with `\`s.
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```
+npm install quotemeta
+```
+
+# license
+
+MIT

0 comments on commit 554f9ad

Please sign in to comment.