Coder Social home page Coder Social logo

nacre's Introduction

Nacre

version-beta

Nacre is an intuitive shell designed for those who prefer to work with objects over text. Want to give it a try?

Builtins at your fingertips

Navigate smoothly with preview, completion and your favorits builtins: ls, cd, chmod, chown, stat, grep, and more.

builtins_black

Automatic module loading

The auto-require mechanism imports your modules when you need it. Explicit import can also be done with require().

import_back

Installation

Nacre relies on NodeJS version 18, so you must have it installed on your system. Follow their installation instructions. Once this is done, install it using:

npm install -g nacre

More details about the installation.

Example

An example is better than a long speech:

> ls()
[ 'foo' ]

> touch('bar')
'bar'

> ls()
[ 'bar', 'foo' ]
  
// inspect foo's permissions
> chmod('foo')
{
  user: { read: true, write: true, execute: false },
  group: { read: true, write: false, execute: false },
  others: { read: true, write: false, execute: false }
}

> chmod.add.execute.user('foo')
{
  user: { read: true, write: true, execute: true },
  group: { read: true, write: false, execute: false },
  others: { read: true, write: false, execute: false }
}

> const perm = chmod('foo')

// inspect the value of perm variable
> perm
{
  user: { read: true, write: true, execute: true },
  group: { read: true, write: false, execute: false },
  others: { read: true, write: false, execute: false }
}

// give bar the same permissions as foo 
> chmod.set('bar', perm)
{
  user: { read: true, write: true, execute: true },
  group: { read: true, write: false, execute: false },
  others: { read: true, write: true, execute: false }
}

Available commands

See the documentation.

Contributing

See CONTRIBUTING.md.

License

MIT. See LICENSE.

nacre's People

Contributors

antsmartian avatar devsnek avatar geppy avatar kixiron avatar nguyenda18 avatar ninroot avatar srl295 avatar timothygu avatar zyszys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nacre's Issues

Install improvement suggestions

There are a few issues when trying this out on macOS:

$ npm install -g nacre
npm WARN deprecated [email protected]: Version no longer supported. Upgrade to @latest

added 27 packages, and audited 28 packages in 12s

4 packages are looking for funding
  run `npm fund` for details

4 vulnerabilities (3 low, 1 moderate)

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

The first main issue is reliance on a deprecated package. I know it can be a real pain to keep dependencies current.

Second issue, need to specify a minimum Node.js version. Here's what happens with 14.x:

$ nacre
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'node:readline'
Require stack:
- /usr/local/lib/node_modules/nacre/built/lib/repl.js
- /usr/local/lib/node_modules/nacre/built/index.js
- /usr/local/lib/node_modules/nacre/bin/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/nacre/built/lib/repl.js:4:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/nacre/built/lib/repl.js',
    '/usr/local/lib/node_modules/nacre/built/index.js',
    '/usr/local/lib/node_modules/nacre/bin/index.js'
  ]
}

Also Node 16.x doesn't seem to work with nacre on M1 Macs:

$ nvm use 16.13.0
Now using node v16.13.0 (npm v8.1.0)
$ nacre
/usr/local/lib/node_modules/nacre/node_modules/bindings/bindings.js:121
        throw e;
        ^

Error: dlopen(/usr/local/lib/node_modules/nacre/node_modules/userid/build/Release/userid.node, 0x0001): tried: '/usr/local/lib/node_modules/nacre/node_modules/userid/build/Release/userid.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at bindings (/usr/local/lib/node_modules/nacre/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/usr/local/lib/node_modules/nacre/node_modules/userid/lib/userid.js:4:37)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'ERR_DLOPEN_FAILED'
}

Whereas Node 17.x seems to work fine:

default[~]$ nacre
Welcome to Nacre version Beta. Find help at https://nacre.sh.
default>

My suggestion:

  1. Detect the node version and warn based on a version that's incompatible
  2. Update the dependencies

Overall, a fun project!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.