Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@guru-js/faker
Advanced tools
This project was originally created and hosted at https://github.com/marak/Faker.js/ - however around 4th Jan, 2022 - the author decided to delete the repository (for unknown reasons).
In the interest of the community, it has been decided that faker.js will continue to be maintained here and all help in its development will be appreciated.
Coming soon!
<script src="faker.js" type="text/javascript"></script>
<script>
var randomName = faker.name.findName(); // Caitlyn Kerluke
var randomEmail = faker.internet.email(); // Rusty@arne.info
var randomCard = faker.helpers.createCard(); // random contact card containing many properties
</script>
var faker = require("faker");
var randomName = faker.name.findName(); // Rowan Nikolaus
var randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz
var randomCard = faker.helpers.createCard(); // random contact card containing many properties
http://marak.github.io/faker.js/
faker.js contains a super useful generator method Faker.fake
for combining faker API methods using a mustache string format.
Example:
console.log(
faker.fake("{{name.lastName}}, {{name.firstName}} {{name.suffix}}")
);
This will interpolate the format string with the value of methods name.lastName()
, name.firstName()
, and name.suffix()
As of version v2.0.0
faker.js has support for multiple localities.
The default language locale is set to English.
Setting a new locale is simple:
// sets locale to de
faker.locale = "de";
faker.js supports incremental loading of locales.
By default, requiring faker
will include all locale data.
In a production environment, you may only want to include the locale data for a specific set of locales.
// loads only de locale
var faker = require("faker/locale/de");
If you want consistent results, you can set your own seed:
faker.seed(123);
var firstRandom = faker.datatype.number();
// Setting the seed again resets the sequence.
faker.seed(123);
var secondRandom = faker.datatype.number();
console.log(firstRandom === secondRandom);
npm install .
npm run test
You can view a code coverage report generated in coverage/lcov-report/index.html.
faker uses gulp to automate its build process. Each build operation is a separate task which can be run independently.
npm run browser
JSDOC v3 HTML API documentation
npm run jsdoc
faker.js is a popular project used by many organizations and individuals in production settings. Major and Minor version releases are generally on a monthly schedule. Bugs fixes are addressed by severity and fixed as soon as possible.
If you require the absolute latest version of faker.js
the master
branch @ http://github.com/marak/faker.js/ should always be up to date and working.
faker.js - Copyright (c) 2020 Marak Squires www.marak.com http://github.com/marak/faker.js/
faker.js was inspired by and has used data definitions from:
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.
Support us with a monthly donation and help us continue our activities. [Become a backer]
Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]
FAQs
Generate massive amounts of fake contextual data
We found that @guru-js/faker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.